所以recenlty我已经得到这个错误我的项目之一:清单合并失败
Error:Execution failed for task ':ListViewAnimations-core-slh:processDebugAndroidTestManifest'.
> java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 7 declared in library [android - AS:StickyListHeaders:unspecified] D:\Android\MDS\UPLOAD\android - AS\ListViewAnimations-core-slh\build\intermediates\exploded-aar\android - AS\StickyListHeaders\unspecified\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="se.emilsjolander.stickylistheaders" to force usage
下面是同一清单文件:
<manifest package="com.example.listviewanimations.slh" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true">
</application>
</manifest>
这里是摇篮文件:
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':ListViewAnimations-core')
compile project(':StickyListHeaders')
}
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
这是怎么发生的?我错过了什么? 非常感谢!
什么是'minSdkVersion'在'build.gradle'文件?您需要将其更改为至少7,如错误消息所述。 –
@ Code-Apprentice实际上我找不到这一行!我已经添加了gradle文件! –
[Manifest合并失败:uses-sdk:minSdkVersion 8不能小于]的可能重复(http://stackoverflow.com/questions/24718824/manifest-merger-failed-uses-sdkminsdkversion-8-cannot-be-smaller) –