AndroidManifest.xml中'指定用于财产'清单'不存在(AndroidStudio)

时间:2014-09-29 08:12:00

标签: android android-studio android-gradle

我不知道为什么会收到以下错误:

错误:找到了任务配置的问题 ':checkDebugManifest&#39 ;.文件 ' /Users/me/Downloads/MyProject/AndroidManifest.xml'指定的 财产'清单'不存在。

有什么建议吗?提前谢谢。

应用程序/的build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.+'
    }
}
allprojects {
    repositories {
        mavenCentral()
    }
}

apply plugin: 'android'
apply plugin: 'android-apt'
def AAVersion = '3.0.1'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "x.y"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"

    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }

    lintOptions {
        abortOnError false
    }
    productFlavors {

    }

    buildTypes {

    }
}

dependencies {
    compile 'com.android.support:support-v4:20.0.0'
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile files('libs/androidannotations-3.0.1.jar')
    compile files('libs/androidannotations-api-3.0.1.jar')
}

MyApp的/应用/的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "x.y"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {

        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:20.0.0'
}

的Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="x.y" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".view.Tabs"
            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>
</manifest>

1 个答案:

答案 0 :(得分:0)

我自己解决了。

build.gradle(生成,无编辑)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

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

allprojects {
    repositories {
        jcenter()
    }
}

应用

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
    }
}
apply plugin: 'android'
apply plugin: 'android-apt'


android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "x.y"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

apt {
    arguments {
        androidManifestFile variant.processResources.manifestFile
        resourcePackageName "x.y"
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.1.+'
    apt "org.androidannotations:androidannotations:3.0+"
    compile files('libs/androidannotations-3.0.1.jar')
    compile files('libs/androidannotations-api-3.0.1.jar')
}