Skip to content
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

Incorrect apkName variable in cli/src/run.ts and cli/src/config.ts for multi dimensional flavors #6703

Closed
julienfdev opened this issue Jul 1, 2023 · 4 comments
Labels
needs reproduction needs reproducible example to illustrate the issue

Comments

@julienfdev
Copy link
Contributor

julienfdev commented Jul 1, 2023

Hi there !

I've just noticed a bug in the way the CLI handles multi-dimensional flavors on Android with Gradle 8+ (didn't try with earlier versions, but I don't see why it would be different)

https://github.com/ionic-team/capacitor/blob/d0ab34fb04d63d6feba496a7c2bd802b455861d6/cli/src/android/run.ts#L53C1-L53C1

Steps to reproduce

From a blank project, add this to build.gradle :

   flavorDimensions "branding", "environment"
    productFlavors {
        foo {
            dimension "branding"
            manifestPlaceholders = [ displayName:"Foo" ]
        }
        bar {
            dimension "branding"
            applicationId = "com.example.bar"
            manifestPlaceholders = [ displayName:"Bar" ]
        }
        prod {
            dimension "environment"
            manifestPlaceholders = [ envSuffix: '']
        }
        beta {
            dimension "environment"
            applicationIdSuffix = ".beta"
            manifestPlaceholders = [ envSuffix: " Beta" ]
        }
        alpha {
            dimension "environment"
            applicationIdSuffix = ".alpha"
            manifestPlaceholders = [ envSuffix: " Alpha" ]
        }
    }

multi dimensional flavor configurations are now :
fooProd, fooBeta, fooAlpha, barProd, barBeta, barAlpha

the current code thus yields an apkName of, for example app-fooProd-debug.apk, while, for multi dimensional flavors, it should be : app-foo-prod-debug.apk, resulting in a ENOENT error.
Launching with Android Studio is fine

I would gladly implement the fix myself but i'm not used to working on CLI tools.

Cheers !
Julien

@julienfdev
Copy link
Contributor Author

I've changed my mind 😅 : #6704

@jcesarmobile jcesarmobile added the needs reproduction needs reproducible example to illustrate the issue label Jul 3, 2023
@ionitron-bot
Copy link

ionitron-bot bot commented Jul 3, 2023

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.
Please see the Contributing Guide for how to create a Code Reproduction.
Thanks! Ionitron 💙

@ionitron-bot ionitron-bot bot removed the triage label Jul 3, 2023
@Ionitron Ionitron added needs reply needs reply from the user and removed needs reply needs reply from the user labels Jul 3, 2023
@jcesarmobile jcesarmobile added the needs reply needs reply from the user label Jul 3, 2023
@Ionitron
Copy link
Collaborator

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron 💙

@Ionitron Ionitron removed the needs reply needs reply from the user label Jul 19, 2023
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 18, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction needs reproducible example to illustrate the issue
Projects
None yet
Development

No branches or pull requests

3 participants