Предварительный просмотр макета в Android Studio не выполняется, и я не уверен, почему.У меня все обновлено до последней версии, и на других компьютерах оно работает нормально.Мой профессор не был уверен, как это исправить, и все остальные посты, отображающие Stack Overflow, которые я мог найти, устарели.Я попытался обновить его, перезапустить, перестроить, сделать недействительными кеши и т. Д.поддерживается.Мой профессор также упомянул, что может быть проблема с Jetpack?Не совсем уверен, что он имеет в виду.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" android:background="@android:color/background_light">
<EditText
android:layout_width="86dp"
android:layout_height="45dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/totalTwentyEditText"
app:layout_constraintStart_toEndOf="@+id/totalFifteenEditText" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline4" android:text="0.00" android:textAlignment="center"
android:focusable="false" android:longClickable="false"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline" app:layout_constraintGuide_begin="20dp"
android:orientation="horizontal"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline2" app:layout_constraintGuide_begin="86dp"
android:orientation="horizontal"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline3" app:layout_constraintGuide_begin="128dp"
android:orientation="horizontal"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline4"
android:orientation="horizontal"
app:layout_constraintGuide_begin="191dp"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline5" app:layout_constraintGuide_begin="259dp"
android:orientation="horizontal"/>
<androidx.constraintlayout.widget.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/guideline6" app:layout_constraintGuide_begin="309dp"
android:orientation="horizontal"/>
<androidx.constraintlayout.widget.Barrier
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/leftColumn"
app:barrierDirection="end"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
app:constraint_referenced_ids="textView3,textView5,textView4,textView2,textView"/>
<TextView
android:text="@string/bill_total"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:id="@+id/textView" android:textSize="18sp"
android:textStyle="bold"
android:textAlignment="viewEnd"
android:textColor="@android:color/black"
android:layout_marginStart="16dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="@+id/billTotalEditText"/>
<TextView
android:text="@string/tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2" android:textSize="18sp"
android:textStyle="bold" android:textAlignment="viewEnd" android:textColor="@android:color/black"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="@+id/leftColumn"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline3"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/tipTenEditText"/>
<TextView
android:text="@string/total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" android:textSize="18sp"
android:textStyle="bold" android:textAlignment="viewEnd" android:textColor="@android:color/black"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="@+id/leftColumn"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline4"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/totalTenEditText"/>
<TextView
android:text="@string/custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:textSize="18sp"
android:textStyle="bold" android:textAlignment="viewEnd" android:textColor="@android:color/black"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="@+id/leftColumn"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline5"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/customSeekBar"/>
<TextView
android:text="@string/tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView5" android:textSize="18sp"
android:textStyle="bold" android:textAlignment="viewEnd" android:textColor="@android:color/black"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="@+id/leftColumn"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline6"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/tipEditText"/>
<EditText
android:layout_width="302dp"
android:layout_height="39dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/billTotalEditText"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline"
android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="@id/leftColumn"
app:layout_constraintHorizontal_bias="0.0" android:text="@string/zeroDecimal"/>
<EditText
android:layout_width="81dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/tipTenEditText"
app:layout_constraintStart_toEndOf="@+id/textView2" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/tipFifteenEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline3" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
<EditText
android:layout_width="86dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/tipFifteenEditText"
app:layout_constraintStart_toEndOf="@+id/tipTenEditText" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/tipTwentyEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline3" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
<EditText
android:layout_width="86dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/tipTwentyEditText"
app:layout_constraintStart_toEndOf="@+id/tipFifteenEditText" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline3" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
<TextView
android:text="@string/tenPercent"
android:layout_width="36dp"
android:layout_height="23dp"
android:id="@+id/textView6" android:textSize="18sp"
android:textAlignment="center" android:textStyle="bold" android:textColor="@android:color/black"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintStart_toStartOf="@+id/tipTenEditText" app:layout_constraintEnd_toEndOf="@+id/tipTenEditText"/>
<TextView
android:text="@string/fifteenPercent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:textSize="18sp"
android:textAlignment="center" android:textStyle="bold" android:textColor="@android:color/black"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintStart_toStartOf="@+id/tipFifteenEditText" app:layout_constraintEnd_toEndOf="@+id/tipFifteenEditText"/>
<TextView
android:text="@string/twentyPercent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:textSize="18sp"
android:textAlignment="center" android:textStyle="bold" android:textColor="@android:color/black"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintStart_toStartOf="@+id/tipTwentyEditText" app:layout_constraintEnd_toEndOf="@+id/tipTwentyEditText"/>
<EditText
android:layout_width="80dp"
android:layout_height="45dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/totalTenEditText"
app:layout_constraintStart_toEndOf="@+id/textView3" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/totalFifteenEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline4" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
<EditText
android:layout_width="86dp"
android:layout_height="45dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/totalFifteenEditText"
app:layout_constraintStart_toEndOf="@+id/totalTenEditText" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/totalTwentyEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline4" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
<SeekBar
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/customSeekBar" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline5" app:layout_constraintEnd_toStartOf="@+id/customTextView"
android:layout_marginEnd="8dp" app:layout_constraintStart_toEndOf="@+id/leftColumn"
android:layout_marginStart="8dp" android:progress="18" android:max="100"/>
<TextView
android:text="@string/eighteenPercent"
android:layout_width="55dp"
android:layout_height="29dp"
android:id="@+id/customTextView" android:textSize="18sp"
android:textAlignment="center" android:textStyle="bold" android:textColor="@android:color/black"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline5"
app:layout_constraintStart_toStartOf="@+id/totalTwentyEditText" app:layout_constraintEnd_toEndOf="@+id/totalTwentyEditText"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/customSeekBar"/>
<EditText
android:layout_width="84dp"
android:layout_height="43dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/tipEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline6"
app:layout_constraintEnd_toEndOf="@+id/totalTenEditText"
app:layout_constraintStart_toStartOf="@+id/totalTenEditText"
android:text="@string/zeroDecimal" android:textAlignment="center" android:focusable="false"
android:longClickable="false"/>
<TextView
android:text="@string/total"
android:layout_width="51dp"
android:layout_height="26dp"
android:id="@+id/textView10" android:textSize="18sp"
android:textStyle="bold" android:textAlignment="viewEnd" android:textColor="@android:color/black"
android:layout_marginTop="8dp" app:layout_constraintTop_toTopOf="@+id/guideline6"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="@+id/tipEditText"
app:layout_constraintStart_toStartOf="@+id/totalFifteenEditText" app:layout_constraintEnd_toEndOf="@+id/totalFifteenEditText"/>
<EditText
android:layout_width="86dp"
android:layout_height="47dp"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/totalEditText" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline6"
app:layout_constraintStart_toStartOf="@+id/totalTwentyEditText"
app:layout_constraintEnd_toEndOf="@+id/totalTwentyEditText"
app:layout_constraintBottom_toBottomOf="@+id/textView10" android:text="@string/zeroDecimal"
android:textAlignment="center" android:focusable="false" android:longClickable="false"/>
</androidx.constraintlayout.widget.ConstraintLayout>
app gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.tipcalculator"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Любая помощь будет оценена.