所以我尝试打开一个较旧的项目来进行一些修复,但我遇到了一个我完全迷失的问题。修复所有 gradle 版本后,更改我导入 native 库的方式等我得到这个错误
Error:Execution failed for task ':wallet:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
问题是我不使用 21.x 支持库。我搜索了整个代码库。 v4 支持库用于两个子项目,但都有
compile 'com.android.support:support-v4:20.0.0'
已定义(没有“+”通配符或任何东西)。我完全不知道它从哪里拖出 21.x 库。如果我尝试在“com.android.support”项目的根目录上“在路径中查找”,我会出现两次 v4:20.0.0 和一次 v13:20.0.0 。如果我搜索“com.android.support:support-v4:21.0.0-rc1”,我找到的唯一引用是在 .idea/workspace.xml 中,没有其他地方。我尝试清理项目,重新启动 IDEA,再次从 SVN 中 check out 项目并执行在 AS 0.8.+ 上运行所需的所有修复,现在我没有想法了。有人遇到过类似的问题吗?任何提示如何解决它?
编辑:
这是我的主要 build.gradle 文件。 “CountryPicker”项目也使用 support-v4(没有其他库),但它也指定了 v4-20.0.0(没有通配符)
最佳答案
我认为这是因为您的应用build.gradle
文件中的compileSdkVersion
和targetSdkVersion
。
如果你的build.gradle
有
compileSdkVersion 'android-L'
targetSdkVersion 'android-L'
你的依赖可以是
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0-rc1'
}
或
如果你的 build.gradle
有
compileSdkVersion 20
targetSdkVersion 20
那么依赖就是这样
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.0.0'
}
编辑
尝试像下面这样更新您的 list 文件。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.app">
.
.
<uses-sdk tools:node="replace" />
.
.
</manifest>
关于Android gradle 正在尝试导入 L 预览支持库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25427497/