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

fix(android): declare namespace / buildconfig options for gradle plugin 8+ compatibility #329

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

ivanignatiev
Copy link
Contributor

@ivanignatiev ivanignatiev commented Oct 10, 2023

Change is required as per announce in community: react-native-community/discussions-and-proposals#671

Fixes #328

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2023

CLA assistant check
All committers have signed the CLA.

@OHHAKO
Copy link

OHHAKO commented Oct 29, 2023

@ivanignatiev hi, thanks for fixing it! you specified the agp version. but why?
I contributed to another repository, but didn't use the terms like you. Because of course I didn't know it was necessary.

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7)

@ivanignatiev
Copy link
Contributor Author

@OHHAKO hi !

I am not sure that it is really really necessary (I am not Java/Grandle expert). Before React Native requirements upgrades, the namespace was taken from AndroidManifest.xml.

For me, it is just a safe formula for backward compatibility for guys who will use the module with older versions of React Native.

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason to specify the version is so that react-native less than 0.66 still works, as it uses gradle < 7 and gradle < 7 does not know about the namespace or buildconfig stuff

So this is a great change. Thanks for your patience! Just now getting to working on my main work app to check it for compatibility (which uses this module, and drives my interest in maintaining this module...)

@mikehardy mikehardy changed the title fix: #328 makes library compatible with rn 0.73 for Android fix(android): declare namespace / buildconfig options for gradle plugin 8+ compatibility Nov 4, 2023
@mikehardy
Copy link
Collaborator

After updating the example app + CI so things would actually build, I pulled this and ran it locally, and it works fine.
CI will check it after a merge to main as well

@mikehardy mikehardy closed this Nov 4, 2023
@mikehardy mikehardy reopened this Nov 4, 2023
@mikehardy mikehardy merged commit 834fd47 into invertase:main Nov 4, 2023
10 of 11 checks passed
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.

Build failed for Android with RN 0.73.0-rc.1 and 0.73.0-rc.2
4 participants