- 我迁移到 android studio 3.1
- 我使用的外部依赖项使用 API 24。我无法在此处进行代码更改。
- 我需要使用 API 26 构建我的应用。
这可能吗?如何做到这一点?
在各种试验中,我遇到了这个错误
Gradle: Error: more than one library with the package name 'recyclerview'
应用程序构建.gradle
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation project(path: ':libs:externalLib', configuration: 'default')
libs:externalLib build.gradle
dependencies {
compile 'com.android.support:recyclerview-v7:24.0.0-alpha2'
compile 'com.android.support:support-v4:24.0.0-alpha2'
}
或者我可以以 API 26 为目标,同时在各处使用 24.x 作为解决方法吗?
最佳答案
您“必须”在 app/build.gradle 文件中添加库依赖项。
关于java - 使用 api 26 构建应用程序,但使用 api 24 构建库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51639735/