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

set namespace in build.gradle #399

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

tarunrajput
Copy link
Contributor

@tarunrajput tarunrajput commented Jun 19, 2023

Summary

Resolves #392

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

More context: react-native-community/discussions-and-proposals#671

@tarunrajput
Copy link
Contributor Author

@jacobp100 , @janicduplessis could you please take a moment to review the PR?

@jacobp100
Copy link
Collaborator

I’m not too sure on this stuff, so I’ll defer to Janic for this

@peterlazar1993
Copy link

Please consider react-native-community/discussions-and-proposals#671 (comment)

@janicduplessis
Copy link
Member

Thanks!

@janicduplessis janicduplessis merged commit 63387b0 into th3rdwave:main Jun 20, 2023
2 checks passed
@ivanignatiev
Copy link

I think removal of package in manifest is optional for backward compatibility.

You also need to add android.buildFeatures.buildConfig true otherwise it will fail:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-safe-area-context'.
> com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is disabled.
  To enable the feature, add the following to your module-level build.gradle:
  `android.buildFeatures.buildConfig true`

BUILD FAILED in 4s
error Failed to install the app.

Also, please take a look on issue #439

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

package="com.th3rdwave.safeareacontext" found in source AndroidManifest.xml
5 participants