首页 > 其他分享 >Gradle

Gradle

时间:2022-11-10 20:14:18浏览次数:43  
标签:xml manifests build AndroidManifest manifestContent Gradle manifestPath

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":[{}]}

 

标签:xml,manifests,build,AndroidManifest,manifestContent,Gradle,manifestPath
From: https://www.cnblogs.com/xyphoenix/p/16878594.html

相关文章