-
Notifications
You must be signed in to change notification settings - Fork 905
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
Add support for namespace inside build.gradle file. #1727
Conversation
This commit introduces the support for getting the Android package from the `namespace` field inside the build.gradle file. Starting from the recent version of AGP, users should use namespace to setup the package rather than AndroidManifest.xml Not doing this, is causing this warning on new apps on console: ``` package="com.androidtemplateproject" found in source AndroidManifest.xml: /tmp/AndroidTemplateProject/android/app/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. ``` This commit allows user to setup the namespace inside the build.gradle to suppress this resolve this warning and still being able to build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for jumping in @cortinico 🎉
@adamTrz Can we get a new alpha release with this commit included? |
how to use this fix if react-native 0.70.5 is using @react-native-community/cli 9.2.1? |
hi @chenop this PR was shipped with v10.0.0 of the CLI, so updating to the newest version should help you |
We could backport this to v9 and issue another release of 0.70.x if that makes sense, I'm just not sure if it does. cc @kelset |
I'm fine either way, but that'd likely mean also a 0.70.x patch and I'm not sure we're planning on making one... we'll figure out later this week I guess. cc @cortinico any opinions? |
So this could technically be backported, as it's fully backward compatible. It's probably good to backport, as we'd like libraries to migrate to use On the other hand, the impact of this is just a warning for now so not super urgent. |
This commit introduces the support for getting the Android package from the `namespace` field inside the build.gradle file. Starting from the recent version of AGP, users should use namespace to setup the package rather than AndroidManifest.xml Not doing this, is causing this warning on new apps on console: ``` package="com.androidtemplateproject" found in source AndroidManifest.xml: /tmp/AndroidTemplateProject/android/app/src/main/AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. ``` This commit allows user to setup the namespace inside the build.gradle to suppress this resolve this warning and still being able to build.
Summary:
This commit introduces the support for getting the Android package from the
namespace
field inside the build.gradle file.Starting from the recent version of AGP, users should use namespace to setup the package rather than AndroidManifest.xml
Not doing this, is causing this warning on new apps on console:
This commit allows user to setup the namespace inside the build.gradle to suppress this resolve this warning and still being able to build.
Fixes: #1721
Also related to facebook/react-native#35094
Test Plan:
I've wrote Jest tests for this + for also the package parsing which were missing.