UNable to implement androidx.appcompat.appcompat:1.0.0

前提是你 提交于 2019-12-20 04:16:25

问题


I am an absolute beginner in Android development and trying to build test automation to test mobile apps. After going through weeks of setting up IntelliJ, I am still facing issues and among them is the following.

As I am using SDK ver 29, I was told that I should convert all "support" keyword to androidx's format as per below:

SO, when I applied it, I am having the red sqiuggly line indicating error at the end of the "1.0.0" as shown below

The following is my app/build.gradle

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 15
        targetSdkVersion 29
        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'])
    //noinspection GradleCompatible
    //implementation 'com.android.support:appcompat-v7:29+'
    implementation androidx.appcompat.appcompat:1.0.0
    //implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    implementation 'androidx.annotation:annotation:1.1.0'
    //androidTestImplementation 'com.android.support.test:runner:1.0.2'
    //androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    //androidTestImplementation 'com.android.support:support-annotations:24.0.0'
    //implementation("com.android.support:support-v4:27.1.1")
    //implementation project(':react-native-fast-image')

}
if(hasProperty('buildScan')){
    buildScan {
        termsOfServiceUrl = 'https://gradle.com/terms-of-service';
        termsOfServiceAgree = 'yes'
    }
}

Hope to have advice on what and where I have done wrong.


回答1:


Use

implementation 'androidx.appcompat:appcompat:1.0.0'

instead of

implementation androidx.appcompat:appcompat:1.0.0


来源:https://stackoverflow.com/questions/57353895/unable-to-implement-androidx-appcompat-appcompat1-0-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!