所以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) –