diff --git a/app/build.gradle b/app/build.gradle index 915d7940e..b9255e4bd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -116,11 +116,15 @@ android { String variantName = variant.name.capitalize() def processManifestTask = project.tasks.getByName("process${variantName}Manifest") processManifestTask.doLast { pm -> - String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml" + String manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml" def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay - if (file(manifestPath).exists() && isGooglePlay==1) { + println "谷歌版本:" + isGooglePlay + println "文件存在" + file(manifestPath).exists() + println "" + (isGooglePlay ==1) + println "" + (file(manifestPath).exists() && isGooglePlay == 1) + if (file(manifestPath).exists() && isGooglePlay == 1) { def manifestContent = file(manifestPath).getText() - + println "移除权限" manifestContent = manifestContent.replace('', '') file(manifestPath).write(manifestContent) } else { @@ -170,7 +174,7 @@ android { isGoogle = "谷歌" } else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) { isGoogle = "Huawei" - }else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) { + } else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) { isGoogle = "Samsung" } def isPlugin = "完整"