清单合并失败,出现多个错误

时间:2015-12-20 08:28:30

标签: android

当我尝试重建项目时,android studio会出错:

Execution failed for task ':app:processDebugManifest'

  

Manifest合并失败,出现多个错误,请参阅日志

我尝试了为此类似问题提供的所有解决方案: Android Gradle Manifest merger failed

以下是应用级build.gradle

apply plugin: 'com.android.application'

android {


    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
    applicationId "io.tnine.myapplication"
    minSdkVersion 18
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.1+'
compile 'com.android.support:support-v4:23.1.1'
}

清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.tnine.myapplication">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:theme="@style/Theme.AppCompat.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>


    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />


    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version"
        />

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"/>

    <activity android:name=".fragment_console"></activity>
 </application>

</manifest>

我应该做出哪些改变?

修改 项目级别build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
 }
}

task clean(type: Delete) {
 delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:0)

检查 [颜色,字符串,尺寸,样式等]中的所有资源文件,检查是否存在不良属性名称不在该文件中出现。 在属性名称中进行更正。 清理项目。