运行项目Could not find the AndroidManifest.xml file, using generation folder

      运行别人发过来的代码时报错了,Could not find the AndroidManifest.xml file, using  generation folder [E:\WorkSpace\AStudio\SpaceXiaobao\KangXiaoBaoDui\app\build\generated\source\apt\dali\debug]) 1 个错误

 

     通过网上一顿查找,终于解决了,现在记录一下解决方法:

在app的build.gradle文件下加入以下内容,然后同步一下即可。

android {
    compileSdkVersion 27
    defaultConfig {
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [
                        'resourcePackageName': "你的包名",
                        "androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()
                ]
            }
        }
    }

}

你可能感兴趣的:(android)