android - 我没有在任何地方使用过编译,但仍然得到 "Configuration ' 编译'已过时,已被 'implementation' 和 'api' 取代“

标签 android gradle

我没有在应用程序或项目级别的 build.gradle 文件中的任何地方使用过编译。但我仍然收到此错误。

我在 stackoverflow 上查看了与此相关的其他问题,但大多数解决方案建议用 api 或实现替换编译,但由于我没有在任何地方使用它,所以我找不到修复方法。请帮忙。

应用级build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.smartseller"
        minSdkVersion 18
        targetSdkVersion 28
        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 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-database:17.0.0'
    implementation 'com.android.support:design:28.0.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.android.support:gridlayout-v7:28.0.0'
    implementation 'com.google.zxing:core:3.2.1'
    implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
}

项目级build.gradle


buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我收到的警告码

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

我正在使用 android studio 版本 3.4.1

最佳答案

在你的 App Level build.gradle 中改变这个 这种依赖性可能有问题

替换这个

     implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'

有了这个

 implementation 'com.journeyapps:zxing-android-embedded:3.6.0'

-:为了支持 Android 14+,将 zxing:core 降级到 3.3.0 或更早版本:-

  implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
  implementation 'com.google.zxing:core:3.3.0'

引用 Link

快乐学习...

关于android - 我没有在任何地方使用过编译,但仍然得到 "Configuration ' 编译'已过时,已被 'implementation' 和 'api' 取代“,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56640679/

相关文章:

android - 运动事件问题

java - Android 无法检索用于 Azure AD 身份验证的正确访问 token

java - 如何将jar发布到Nexus(快照存储库)?

未捕获 Android 引荐来源参数

java - Android - 从 DatePickerDialog 更改线条颜色

android - 使用 zxing 条码扫描器创建产品数据库将数据添加到数据库问题

gradle - 如何在 Gradle 多项目构建中包含对子模块的父测试类的依赖项?

java - 在 Gradle 中获取 POM 父级

android - 带有Gradle的Android Studio拼写检查器

gradle - org/jetbrains/kotlin/android/synthetic/idea/AndroidExtensions Gradle模型:不受支持的major.minor版本52.0