Repository navigation
Description
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.
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:
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 theaddGeneratedSourceDirectorywas not there7.3.x-> Unusable asaddGeneratedSourceDirectoryis broken for resources. This was causing Static images are not rendered on Android for 0.71.0-rc.0 #35439 on our previous RC. A fix has been shipped by Google's, and is available in7.4. I’ve asked for a backport of the fix in7.3but it seems like there are no more7.3.xreleases 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 asaddGeneratedSourceDirectorygot 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.0but we’ll have to wait for7.4.1apparently.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
Activity
cortinico commentedon Dec 7, 2022
I'm investigating the feasibility of not invoking:
entirely as it's broken, pass and hardcoded
resourcesDirsimilar to what we were doing in 0.70.x and use AGP7.3.1at least to unblock the release.Smarking commentedon Dec 7, 2022
Smarking commentedon Dec 7, 2022
De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory`
cortinico commentedon 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.
kelset commentedon Dec 14, 2022
(the commit will land in 0.71 RC5)
De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory` (#3…
cortinico commentedon Feb 2, 2023
Just a heads up that Google released AGP 7.4.1 which fixes the bug with
addGeneratedSourceDirectoryand we're bumping it in:androideveloper commentedon Mar 14, 2023
Hi @cortinico! Thanks for the update here. Any known issues when running RN 0.70 with AGP 7.4.1?
cortinico commentedon Mar 16, 2023
We haven't tested it so that's not recommended.