-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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.
classpath("com.android.tools.build:gradle:7.4.0-beta05") |
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:
Lines 73 to 74 in e3f2419
variant.sources.res?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::resourcesDir) | |
variant.sources.assets?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::jsBundleDir) |
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 theaddGeneratedSourceDirectory
was not there7.3.x
-> Unusable asaddGeneratedSourceDirectory
is 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.3
but it seems like there are no more7.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 asaddGeneratedSourceDirectory
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 for7.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