Gradle
Mirror
allprojects{ repositories { def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public' def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('http://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/') || url.startsWith('http://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL url ALIYUN_JCENTER_URL } } buildscript{ repositories { def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/repository/public' def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/repository/jcenter' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('http://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/') || url.startsWith('http://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL url ALIYUN_JCENTER_URL url 'http://maven.aliyun.com/repository/google' url 'https://mvn.getui.com/nexus/content/repositories/releases/' url 'http://mirrors.huaweicloud.com/repository/maven/' allowInsecureProtocol = true } } } }
repositories { //google() //jcenter() maven { url 'https://maven.aliyun.com/repository/public/' } maven { url 'https://maven.aliyun.com/repository/google/' } maven { url 'https://maven.aliyun.com/repository/jcenter/' } maven { url "https://mvn.getui.com/nexus/content/repositories/releases/" } maven { url 'http://mirrors.huaweicloud.com/repository/maven/' allowInsecureProtocol = true } mavenLocal() mavenCentral() }
Process AndroidManifest.xml
processXxxManifestForPackage - build/intermediates/packaged_manifests/fullRelease/AndroidManifest.xml
processFullReleaseManifest - build/intermediates/merged_manifests/fullRelease/AndroidManifest.xml
Modify packaged AndroidManifest.xml before packing.
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.processResources.doFirst { pm->
String manifestPath = output.processResources.manifestFile;
manifestPath = manifestPath.replace('merged_manifests', 'packaged_manifests');
print(manifestPath);
def manifestContent = file(manifestPath).getText('UTF-8') manifestContent = manifestContent.replace('SOURCE_STRING', 'TARGET_STRING') file(manifestPath).write(manifestContent, 'UTF-8') } } }
It will get the warning, but can work normally.
AGPBI: {"kind":"warning","text":"API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.\nIt will be removed in version 7.0 of the Android Gradle plugin.\nFor more information, see https://d.android.com/r/tools/task-configuration-avoidance.\nREASON: Called from: C:\\Android\\Code\\com.citrix.receiver.client\\UI\\app\\build.gradle:26\nWARNING: Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.","sources":[{}]}