【问题标题】:ERROR: Failed to resolve: androidx.annotation.annotation:1.1.0: Affected Modules: app错误:无法解决:androidx.annotation.annotation:1.1.0:受影响的模块:app
【发布时间】:2020-01-31 13:02:38
【问题描述】:

我尝试添加这个包androidx.annotation.annotation:1.1.0 来解决一些问题,但我明白了

错误:无法解决:androidx.annotation.annotation:1.1.0: 受影响的模块:app 这是我的 build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.jakewharton.hugo'
android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.app.test"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation group: 'com.google.guava', name: 'guava', version: '26.0-android'
    implementation 'com.google.firebase:firebase-core:17.2.0'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'
    implementation 'androidx.annotation.annotation:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
    implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
    implementation 'com.anjlab.android.iab.v3:library:1.0.44'
    implementation 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
    implementation 'com.jakewharton:butterknife:10.1.0'
}

我能做些什么来解决这个问题

【问题讨论】:

    标签: java android android-studio gradle build.gradle


    【解决方案1】:

    androidx.annotation.annotation:1.1.0 不是正确的依赖声明。

    正确的是

    androidx.annotation:annotation:1.1.0
    

    Link

    【讨论】:

      【解决方案2】:

      在模块 build.gradle 文件中使用这个 lint 选项

      lintOptions { 
          checkReleaseBuilds false
      }
      

      【讨论】:

        【解决方案3】:

        在项目中添加类路径'com.android.tools.build:gradle:7.0.4'

        【讨论】:

        • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。
        猜你喜欢
        • 1970-01-01
        • 2020-09-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-17
        • 2018-09-25
        • 1970-01-01
        相关资源
        最近更新 更多