diff --git a/android/app/build.gradle b/android/app/build.gradle index 56099a9..cba7fec 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -25,9 +25,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout: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' + androidTestImplementation 'androidx.test:runner:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/android/app/src/androidTest/java/com/example/android/ExampleInstrumentedTest.kt b/android/app/src/androidTest/java/com/example/android/ExampleInstrumentedTest.kt index e7f8d5e..a690ceb 100644 --- a/android/app/src/androidTest/java/com/example/android/ExampleInstrumentedTest.kt +++ b/android/app/src/androidTest/java/com/example/android/ExampleInstrumentedTest.kt @@ -1,13 +1,12 @@ package com.example.android -import android.support.test.InstrumentationRegistry -import android.support.test.runner.AndroidJUnit4 - +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.runner.AndroidJUnit4 +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * @@ -18,7 +17,7 @@ class ExampleInstrumentedTest { @Test fun useAppContext() { // Context of the app under test. - val appContext = InstrumentationRegistry.getTargetContext() + val appContext = InstrumentationRegistry.getInstrumentation().context assertEquals("example.com.android", appContext.packageName) } } diff --git a/android/app/src/main/java/com/example/android/MainActivity.kt b/android/app/src/main/java/com/example/android/MainActivity.kt index f901095..9f03509 100644 --- a/android/app/src/main/java/com/example/android/MainActivity.kt +++ b/android/app/src/main/java/com/example/android/MainActivity.kt @@ -1,6 +1,6 @@ package com.example.android -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.util.Log diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml index 980638c..716af5a 100644 --- a/android/app/src/main/res/layout/activity_main.xml +++ b/android/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 85be9ea..3d8ce0c 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m # org.gradle.parallel=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official +android.useAndroidX=true +android.enableJetifier=true