我将我的项目从eclipse迁移到Android Studio并遇到错误:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
我已经搜索过这个问题并看到我需要使用
xmlns:tools="http://schemas.android.com/tools"
清单标签中的和
tools:node="replace"
tools:replace="icon"
在应用程序标记中。但这对我没有帮助。我认为与Gradle / Manifest工作失败有关,但不知道在哪里
此处显示(它是App模块中唯一的清单)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vladdrummer.headsup"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="7"
android:versionName="1.01" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="25" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
tools:node="replace"
tools:replace="icon">
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
以及这里的Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.vladdrummer.headsup"
minSdkVersion 11
targetSdkVersion 25
versionCode 7
versionName "1.01"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile "com.android.support:support-core-utils:25.1.0"
testCompile 'junit:junit:4.12'
compile project(':ldialogs')
}
以防万一:这是图书馆的(模块)清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.me.lewisdeane.ldialogs">
<application android:allowBackup="true" android:label="@string/lib_name"
android:supportsRtl="true">
</application>
</manifest>
以及模块的Gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
}