【问题标题】:How to resolve 'com.android.support:appcompat-v7:28.0.0'如何解决“com.android.support:appcompat-v7:28.0.0”
【发布时间】:2020-05-12 03:05:10
【问题描述】:

该应用已经有 implementation 'com.android.support:appcompat-v7:26.0.0'。所以为了保持更新,我将其更改为 28.0.0。而且我仍然得到配置“编译”已过时,已被“实施”和“API”取代。错误。

我怎样才能永久解决这个错误。 我尝试了很多针对类似问题提供的不同解决方案,但都没有奏效。

更新 build.gradle 在下面

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "man.ravi.app"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 2
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            multiDexEnabled true
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:26.1.0'
    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'
    implementation 'com.adefruandta.spinningwheel:spinningwheel:0.1.0'
    implementation 'com.google.firebase:firebase-core:10.0.1'
    implementation 'com.google.firebase:firebase-database:10.0.1'
    implementation 'org.immutables:gson:2.6.1'
    implementation 'com.google.android.gms:play-services:10.0.1'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'
    implementation 'com.google.android.gms:play-services-ads:10.0.1'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'gun0912.ted:tedpermission:2.1.0'

}
apply plugin: 'com.google.gms.google-services'

顺便说一句..你可以`忽略顶部的compileSdkVersion。它曾经是 implementationSdkVersion 导致一堆其他错误..然后我将其更改为 compileSdkVersion.

【问题讨论】:

  • 请发布您的 build.gradle 吗?
  • 尝试在你的build.gradle文件中搜索“compile”字样并替换为“implementation”,同时将“testCompile”替换为“testImplementation”
  • 这些不是错误,而是警告,你可以忽略它们
  • @haresh 请查看 build.gradle
  • @easy_breezy 我搜索了,但找不到任何编译。

标签: android android-studio error-handling build


【解决方案1】:

就我而言,我只是在项目级 gradle 中更新 Google 服务。

      classpath 'com.google.gms:google-services:3.2.0' 

【讨论】:

  • 只需将项目级 gradle 中的 google 服务更新到最新版本即可。
  • 不,那没有用,但我想出了问题所在。现在完成了。让我知道我是否应该发布答案。
猜你喜欢
  • 1970-01-01
  • 2019-04-05
  • 1970-01-01
  • 1970-01-01
  • 2021-02-26
  • 1970-01-01
  • 2020-01-04
  • 2019-04-17
相关资源
最近更新 更多