flutterfire_cli icon indicating copy to clipboard operation
flutterfire_cli copied to clipboard

request: Document how android package name and ios and mac os bundle ids are detected

Open HemilTheRebel opened this issue 2 years ago • 0 comments

Is there an existing feature request for this?

  • [X] I have searched the existing issues.

Command

NA

Description

In flutterfire configure --help, please document how the android package name and ios and mac os bundle ids are automatically detected. I had a build.gradle file like this:

defaultConfig {
    // applicationId "abc.def.ghi"
    applicationId "ghi.def.abc"
}

And flutterfire kept on using the commented version for some reason. It took me an hour of digging through the code to realize that the tool is using a simple regex match which does not take gradle semantics into account. The tool also tries different ways like finding build.gradle, checking for AndroidManifest.xml, etc.

It would be great if this is documented somewhere in the help.

Yes, I could specify the package name manually but I was curious why it was picking the wrong one.

Reasoning

It would avoid the confusion and help developers check why the wrong package id is being selected by default when the tool is run. While you can manually override the package id, what the tool does to figure the configuration is useful information to have

Additional context and comments

Another thing that could be done is to print out the decisions in --verbose like: $ flutterfire configure --verbose

Looking for project id in android/app/build.gradle using regex match

HemilTheRebel avatar Oct 19 '22 11:10 HemilTheRebel