-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change 'app' to ${project.archivesBaseName} #73919
Comments
Hi @v7lin |
it is not important. but it is useful. |
It is important to know why a change should be made. |
the ${project.archivesBaseName} default value is 'app', it will not cause break change. |
I think this is a request to build the APK to known location based on app name instead of hardcoding "app-" prefix? The referenced referenced is in dart, See also #54328 |
@jmagman I think he wants to be able to rename the apk / bundle without getting errors. For example if you perform
with the following defaultConfig:
It will eventually throw the following error stating an unsupported Android Plugin:
|
@jmagman we can use the following code to get app bundle file / apk file // https://github.com/android/gradle-recipes/blob/agp-8.1/getSingleArtifact/build-logic/plugins/src/main/kotlin/CustomPlugin.kt
// https://gist.github.com/ychescale9/fffef60e49de36375698997b277fab9d
// https://github.com/Triple-T/gradle-play-publisher/blob/master/play/plugin/src/main/kotlin/com/github/triplet/gradle/play/PlayPublisherPlugin.kt#L216C23-L216C63
def builtArtifacts = variant.artifacts.getBuiltArtifactsLoader().load(variant.artifacts.get(SingleArtifact.APK).get()) ?: throw RuntimeException("Cannot load APKs")
def apkFile = File(builtArtifacts.elements.single().outputFile) // apk // https://github.com/android/gradle-recipes/blob/agp-8.1/getSingleArtifact/build-logic/plugins/src/main/kotlin/CustomPlugin.kt#L47
def bundleFile = variant.artifacts.get(SingleArtifact.BUNDLE).get().asFile // aab |
flutter/packages/flutter_tools/lib/src/android/gradle.dart
Line 905 in e0dcb78
android-gradle-build-renaming-the-apk
The text was updated successfully, but these errors were encountered: