我没有在应用程序或项目级别的 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/