[英]Disable Manifest Merger in Android Gradle Build 3.1.2
android.applicationVariants.all { variant ->
androidManifestFile variant.outputs[0].processResources.manifestFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false
}
Cannot set the value of read-only property 'manifestFile' for task ':app:processDebugResources' of type com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask. 无法为com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask类型的任务':app:processDebugResources'设置只读属性'manifestFile'的值。
Use manifestOutputFile
instead of manifestFile
as follows: 使用manifestOutputFile
代替manifestFile
,如下所示:
android.applicationVariants.all { variant ->
androidManifestFile variant.outputs[0].processResources.manifestOutputFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false
}
Also remember to disable Instant Run
option in case you are still facing issues, since it has some issues. 另外,请记住禁用“ Instant Run
选项,以防万一您仍然遇到问题,因为它存在一些问题。 In case its mandatory for you to use Instant Run
refer to this SO which describes how to achieve it 如果您必须使用“ Instant Run
请参考此SO ,其中描述了如何实现它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.