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

Application ID does not appear in Android files (AndroidManifest and MainActivity) #1035

Open
icodeyou opened this issue May 3, 2024 · 3 comments
Labels
has reproductive steps This issue contains detailed steps to reproduce the issue investigating This is currently being looked into to understand the cause/scope

Comments

@icodeyou
Copy link

icodeyou commented May 3, 2024

Description

When we create a project, the argument --argument-id is not used in several Android config files.

Steps To Reproduce

  1. Create a Flutter project with the command : very_good create flutter_app foo --application-id com.foo.app

  2. Open the files :

  • foo/android/app/src/main/AndroidManifest.xml
  • foo/android/app/src/debug/AndroidManifest.xml
  • foo/android/app/src/profile/AndroidManifest.xml
  • foo/android/app/src/main/kotlin/com/foo/MainActivity.kt
  1. Check the package names in those files

  2. Start again with the command : very_good create flutter_app foo --org com.foo --application-id com.foo.app

Expected Behavior

The package name must be : com.foo.app

But it is instead : com.example.verygoodcore.foo or com.foo.foo

Screenshots
image

@icodeyou icodeyou added the bug Something isn't working as expected label May 3, 2024
@alestiago
Copy link
Contributor

Hi @icodeyou thanks for opening an issue 💙 !

I've been able to reproduce this in very_good_cli 0.21.0. When creating using very_good create flutter_app foo --application-id com.foo.app my manifest package is com.foo.foo. Whereas the default config applicationId is simply "com.foo.app" (at build.gradel).

@TofferJ are you able to reproduce and verify the need of this change? Currently the manifest package name is intended to be {{org_name.dotCase()}}.{{project_name.snakeCase()}},

@alestiago alestiago added has reproductive steps This issue contains detailed steps to reproduce the issue investigating This is currently being looked into to understand the cause/scope and removed bug Something isn't working as expected labels May 16, 2024
@cjakobsen-ncl
Copy link

The application ID should not be in the AndroidManifest or the MainActivity class. It resides in the build.gradle file, as @alestiago mentioned above. It is only used to identify your application in the Play Store.

The package name in the AndroidManifest is what dictates the directory structure of your code. It is what you should see in package definition in e.g. the MainActivity class.

It is perfectly fine for the two to be different. The package name can be changed at any time, but the application ID can not be changed once your app has been published.

You could argue that it might be expected, or nicer, to have them both be the same after initializing the project. Personally, I think that having different default values helps people understand that they are not one and the same. I would recommend keeping things as is for now, but continue to monitor any feedback related to their default values.

@icodeyou
Copy link
Author

I see. It is good to know that it has no impact on the way it is identified by the Play Store.

I still prefer to have a package name identical to the application ID, because I believe it is what is done by default when you create an native Android project. I think it would be great to keep things as closely as the way it is for most projects.

By the way, when we create a project with flutter create the application ID and the package are identical.
Is there a good reason to change this behavior ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has reproductive steps This issue contains detailed steps to reproduce the issue investigating This is currently being looked into to understand the cause/scope
Projects
Status: Community
Development

No branches or pull requests

3 participants