Android Studio Gradle文件Manifest.xml无效

Dai*_*vid 5 configuration android gradle android-manifest android-studio

我正在尝试在AndroidStudio版本0.4.4上构建我的android项目,但在我触及文件build.gradle之后出现问题,现在看起来像这样:

apply plugin: 'android'
            android {
                compileSdkVersion 19
                buildToolsVersion "19.0.1"

                defaultConfig {
                    minSdkVersion 9
                    targetSdkVersion 19
                    versionCode 1
                    versionName "1.0"
                }

                signingConfigs {
                    release {
                        storeFile file('somekey.jks')
                        storePassword "pass"
                        keyAlias "alias"
                        keyPassword "pass"
                    }
                }

                buildTypes {
                    release {
                        signingConfig signingConfigs.release
                        runProguard false
                        debuggable false
                        jniDebugBuild false
                        zipAlign true
                        renderscriptDebugBuild false
                        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
                    }

                    debug {
                        debuggable true
                        jniDebugBuild true
                        renderscriptDebugBuild true
                    }
                }
            }

            dependencies {
                compile 'com.android.support:gridlayout-v7:19.0.1'
                compile 'com.android.support:support-v4:19.0.1'
                compile 'com.android.support:appcompat-v7:+'
                compile 'com.google.android.gms:play-services:4.2.42'
            }
Run Code Online (Sandbox Code Playgroud)

之前是这样的:

apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"

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

dependencies {
    compile 'com.android.support:gridlayout-v7:19.0.1'
    compile 'com.android.support:support-v4:19.0.1'
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.google.android.gms:play-services:4.2.42'
}
Run Code Online (Sandbox Code Playgroud)

现在我每次尝试运行项目时都会出现此错误:

Throwable: Invalid file: file://C:/Users/user/AndroidStudioProjects/myprojectname/myproject/build/manifests/debug/AndroidManifest.xml
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这一问题?

pyu*_*s13 20

巧合的是,一旦我评论了你的问题,我也得到了同样的错误,我自己解决了这个问题.

File > Invalidate Caches/Restart
Run Code Online (Sandbox Code Playgroud)

解决了我的问题.