question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.71] Release of React Native 0.71 is currently blocked by an AGP stable release

See original GitHub issue

Description

Hey all, I’m opening this issue to track the current status of a blocker for the release of React Native 0.71.x. We’ll use this issue to track the status and decide what to do next.

The problem

We’re about to ship 0.71.0 with a version of AGP (Android Gradle Plugin) which is 7.4.0-beta05, the last known version of AGP that is working with the current setup of React Native.

https://github.com/facebook/react-native/blob/e6563daeeb35bd865d41ef2ee2f7fb480835eb3a/template/android/build.gradle#L18

This has the unfortunate side effect that users will be able to open newly created projects only inside Android Studio Electric Eel version 7.4.0-beta05. When opening such a project with a different version of Android Studio (say 7.4.0 stable), they’ll be prompted to “update” their Android project to the corresponding version, resulting in a build failure.

Overview of AGP versions

Specifically, the offending API is the addGeneratedSourceDirectory method used to inject the JS bundle and the static asset inside the final APK:

https://github.com/facebook/react-native/blob/e3f24195c4ec82465492d8210240ae51e55c6c0b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt#L73-L74

We’ve been investigating AGP versions and if we can use another non-broken versions of AGP. Here an overview.

  • 7.2.x -> Unusable as the addGeneratedSourceDirectory was not there
  • 7.3.x -> Unusable as addGeneratedSourceDirectory is broken for resources. This was causing #35439 on our previous RC. A fix has been shipped by Google’s, and is available in 7.4. I’ve asked for a backport of the fix in 7.3 but it seems like there are no more 7.3.x releases planned.
  • 7.4.0-beta05 -> That’s the last AGP version where this API is working (the one we’re about to ship).
  • 7.4.0-rc01 -> Unusable as addGeneratedSourceDirectory got broken inside RC01. I’ve reported the issue and got it fixed (which is great!)
  • 7.4.0 -> Unusable as the fix for the broken API won’t land in .0 but we’ll have to wait for 7.4.1 apparently.
  • 7.4.1 -> Seems like we’ll have to wait for this version (sadly we don’t have an ETA from Google’s end on this).

Version

0.71.0

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:7
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kelsetcommented, Dec 14, 2022

(the commit will land in 0.71 RC5)

2reactions
cortinicocommented, Dec 14, 2022

We ended up de-bumping AGP to 7.3 to unblock the release of RN 0.71 as Google is not providing any ETA on AGP 7.4 and the current releases are all broken.

The de-bump is circumventing the broken APIs on AGP 7.3 so we should be good to go. This will also allow to open RN projects on .71 with both Android Studio Electric Eel and Dolphin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Versions · React Native
React Native versions. Open source React Native releases follow a release train that is coordinated on GitHub through the react-native-releases repository.
Read more >
configure project :react-native-reanimated aar for ... - You.com
Failed to transform react-native-0.71.0-rc.0-debug.aar ... is incompatible with the current version of React and that it needs to be downgrade to version 7....
Read more >
app:checkDebugAarMetadata FAILED when run react-native ...
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (30) specified in a ...
Read more >
react-native | Yarn - Package Manager
Learn once, write anywhere: Build mobile apps with React. React Native is released under the MIT license. Current CircleCI build status. Current npm...
Read more >
React Native (@reactnative) / Twitter
0.71.0-rc.2 of #reactnative⚛️ release is out! We did RC1 yesterday but there was a problem iOS side ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found