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): add namespace to build.gradle for android gradle plugin 8 compatibility #4229

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

mikehardy
Copy link
Contributor

Description

I may be wrong, but I believe this is necessary for android gradle plugin 8 compatibility, which is what react-native 0.73 will ship with. I'm working through compat issues right now as I bump into them, testing release candidates

fix(android): add namespace to build.gradle for android gradle plugin 8 compatibility

Related: invertase/react-native-firebase@19ae9b8

@mikehardy
Copy link
Contributor Author

squash merge - I didn't do the complete / backwards-compatible fix first, sorry :-). Ignore if you all are already handling this another way, of course

@noomorph
Copy link
Collaborator

@mikehardy , thanks a lot for the effort! Should we verify this with 0.73.0-rc.2?

@mikehardy
Copy link
Contributor Author

Any app that switches to android gradle plugin V8+ will verify, for example a test app, for example the react-native-firebase e2e app 😂

This is true even while still on older gradle or rn 72, it's the android Gradle plugin version in main app module that drives the change

@@ -21,6 +21,10 @@ def _rnNativeArtifact = rnInfo.isRN71OrHigher
: 'com.facebook.react:react-native:+'

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

Choose a reason for hiding this comment

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

One more question, @mikehardy. You state in the title about Gradle Plugin 8+, but here you check >= 7, could you explain, please?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mikehardy would you be kind to answer, please? I don't have the intention to keep this PR pending for long, and your prompt answer will help me merge it sooner. Thanks! 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I didn't see this until just now - this wasn't just a breaking change, it was a non-backwards-compatible breaking change (that is, it will only work on AGP8+), but people may still use it on AGP7! So this was the only way the community came up with for it to work on old and new at the same time. Pain in the butt! 😆

@noomorph noomorph merged commit 89c14ef into wix:master Oct 26, 2023
3 checks passed
@mikehardy mikehardy deleted the patch-2 branch October 31, 2023 19:50
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