简体   繁体   English

AndroidManifest.xml - 为属性'manifest'指定的不存在

[英]AndroidManifest.xml - specified for property 'manifest' does not exist

This is the error I'm getting and one that is seemingly unfixable from what I've been searching through on StackOverflow. 这是我得到的错误,这个错误似乎与我在StackOverflow上搜索的内容无法解决。

Error:A problem was found with the configuration of task ':checkDebugManifest'.
> File '/Users/wasimsandhu/AndroidStudioProjects/Conjugation/src/main/AndroidManifest.xml' 
specified for property 'manifest' does not exist.

I keep getting this error every time I rebuild the project or sync Gradle files. 每次重建项目或同步Gradle文件时,我都会收到此错误。 I have tried solutions in various other threads here to no avail. 我在其他各种线程中尝试过解决方案无济于事。

Here is my app/build.gradle file: 这是我的app / build.gradle文件:

apply plugin: 'com.android.application'

android {
signingConfigs {
    config {
        // removed for this post
    }
}

compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
    applicationId "com.wsandhu.conjugation"
    minSdkVersion 15
    targetSdkVersion 19
    versionCode 1
    versionName "0.5"
}

buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'de.cketti.library.changelog:ckchangelog:1.2.1'
    compile 'com.nispok:snackbar:2.0.1'
}

And here is the build.gradle file in the root directory: 这是根目录中的build.gradle文件:

apply plugin: 'com.android.application'

// 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.2'

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

allprojects {
repositories {
    jcenter()
}
}

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.wsandhu.conjugation"
    minSdkVersion 15
    targetSdkVersion 19
    versionCode 1
    versionName "0.5"
    }
}

AndroidManifest.xml: AndroidManifest.xml中:

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
        <activity
            android:name=".MainActivity"
            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>

And here is the gradle wrapper file, in case that is important: 这里是gradle包装器文件,如果重要的话:

#Mon Nov 17 20:04:45 PST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip

I apologize in advance for the bad formatting or if anything is unclear. 我提前为错误的格式化道歉或者如果有什么不清楚的话。

Remove this chunk of code from your build.gradle in the root directory 从根目录中的build.gradle中删除此代码块

apply plugin: 'com.android.application'

and

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.wsandhu.conjugation"
    minSdkVersion 15
    targetSdkVersion 19
    versionCode 1
    versionName "0.5"
    }
}

As it says that: 正如它所说:

// NOTE: Do not place your application dependencies here; //注意:不要在此处放置应用程序依赖项; they belong in the individual module build.gradle files 它们属于单个模块build.gradle文件

Meaning this line of code goes to in the gradle file inside your app folder. 这意味着这行代码会进入app文件夹中的gradle文件。

Try making your top gradle file like this: 尝试制作这样的顶级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:1.5.0'
    }

}

allprojects {
    repositories {
        jcenter()
    }
}

I had the same problem before. 我之前遇到过同样的问题。 So I think this will solve your case. 所以我认为这将解决你的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM