-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
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 |
@mikehardy , thanks a lot for the effort! Should we verify this with 0.73.0-rc.2? |
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) { |
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.
One more question, @mikehardy. You state in the title about Gradle Plugin 8+, but here you check >= 7, could you explain, please?
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.
@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! 🙏
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.
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! 😆
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
Related: invertase/react-native-firebase@19ae9b8