Closed LukeLinXu closed 4 years ago
What tasks are you running?
@SUPERCILEX publishApk
, which lead to commitEditFor
, where the mistake happened.
Right, you probably need to publish the specific product flavor that's valid. publishApk
will publish everything. ./gradlew app:tasks --group publishing
should give you the list.
@SUPERCILEX I'm publishing correct specific product flavor.
android.applicationVariants.all
If I ran "assembleUat", I can get correct apk and applicationId with ".uat2" in both cases.
But when run with publishUatApk
, plugin will get application id differently, which lead to different commitEditFor
By case 1/2, do you mean publishUatApk
is running two actions? If so, you'll need to run the most specific task.
If not, is there a reason you can't just have two separate build types? I'm not really willing to figure out ways to make the plugin work with hacky build logic... though I think if you applied the plugin last, it might get the correct app ids. You'd have to follow the legacy instructions here and then put the apply plugin: "com.github.triplet.play"
below everything else.
@SUPERCILEX thx, yes, cuz we have 1 dimen called "locale" which should lead to multiple uat build, but we just want to make usUat as special case.
to be honest, it works fine before with case2. but after update android.tools.build gradle from 3.5.3 to 4.0.1, then it mess up with this special case. for other flavors , they are working fine.
So I guess might be the gradle changed the why to get applicationId, which lead your plugin failed with this special case.
Oh yeah, if an AGP update broke the ordering, I think applying the plugin last could fix it.
@SUPERCILEX thx, will try
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Thx, it works.
Describe the bug
for some reasons, we need to update application id from ends with “.uat” to “.uat2" for 1 special build flavor. So this plugin can upload apk with
uat { dimension “env” applicationIdSuffix “.uat2" }
but failed to upload apk with
uat { dimension “env” applicationIdSuffix “.uat” }
android.applicationVariants.all { variant -> if (variant.productFlavors[0].name.equals(“us”) && variant.productFlavors[1].name.equals(“uat”)) { variant.mergedFlavor.setApplicationIdSuffix(“.uat2”) } }
so it looks like when plugin try to get applicationId, it will ignore my special setup, and use wrong “commitEditFor” taskandroid.applicationVariants.all { variant ->
is it anyway to make it work?