我在将 eclipse 项目导入 Android studio 时遇到此错误。它显示了将库 Gradle: com.android.support:support-core-utils-27.1.1
添加到类路径的建议。我已将库添加到我的 build.gradle
文件中。
这是我的 gradle 文件。
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.example.tracking"
minSdkVersion 17
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
allprojects {
repositories {
google()
}
}
dependencies {
implementation project(':asciiProtocol')
implementation project(':deviceList')
implementation project(':captureActivity')
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "com.android.support:support-core-utils:27.1.1"
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation files('libs/opencsv-2.3.jar')
implementation files('libs/rfid.reader.api.jar')
implementation files('libs/scannercontrol.jar')
implementation files('libs/Zebra.jar')
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.1'
}
}
}
}
}
我用谷歌搜索,但找不到合适的解决方案。但是,我尝试了 这个 不是正确解决方案的解决方案。任何帮助表示赞赏?
原文由 Jack 发布,翻译遵循 CC BY-SA 4.0 许可协议
我遇到了同样的问题,然后我注意到谷歌将 v4 支持库划分为多个包。
https://developer.android.com/topic/libraries/support-library/packages#v4
然后我检查了 LocalBroadcast 页面。 https://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager
在页面顶部,有说明
当我遇到这个问题时,v28.0.0(非 alpha)已经可用。
最后,我更改了
build.gradle
中的设置。前
后
安卓X