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

feat: Add Android Gradle Plugin namespace support #900

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ali-Oliaee
Copy link

Adds a version check to conditionally set the namespace for Android builds using Gradle Plugin version 7.3.0 and above.

Adds a version check to conditionally set the namespace for Android builds using Gradle Plugin version 7.3.0 and above.
@Ali-Oliaee
Copy link
Author

@henninghall Hi, can you review this mr please

@henninghall
Copy link
Owner

Hi @Ali-Oliaee , thanks for you contribution!

What issue does this solve? What react native version/expo version etc?

It has been up for discussion before: #726

@Ali-Oliaee
Copy link
Author

Hi again @henninghall,

I checked the discussion you mentioned, I didn't find any recursion or namespace support from react native team or Gradle,
but I think these changes are necessary because I have no plans to update my project versions and I'm sure we have similar circumstances for other projects in production level.

This issue is related to Gradle's namespace support, you don't need to specify the package name in your Android manifest file, but you must declare it in the build.gradle file, otherwise you will get the following error:

Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

android {
    namespace 'com.example.namespace'
}

And this update was applied from Gradle 7.3.0 above.

If you have any documentation about Gradle future plans or alternative solutions, please share with me, we can add another restriction to these PR changes and set a minimum and maximum for Gradle version support.
I have now controlled this problem with the patch package but I think it's better to set these changes on package level.

What do you think?

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.

2 participants