-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Static images are not rendered on Android for 0.71.0-rc.0 #35439
Comments
Thansk for sharing this @louiszawadzki It's under my radar. I'll try to reproduce and get back to you |
I was able to reproduce. That's a bug on AGP 7.3 So either we bump AGP to 7.4.0-beta05 or we try to ask for a backport of that fix on AGP 7.3 |
Summary: Fixes facebook#35439 There is a bug in AGP 7.3.x which is causing assets to don't be copied properly inside the final artifact: issuetracker.google.com/issues/237421684 As AGP 7.4.x is really close to release (is in Beta5, should be released stable in the next weeks) we should be fine by bumping to beta5. This also requires a bump of RNGP Changelog: [Android] [Changed] - Bump AGP to 7.4.x allow-large-files Differential Revision: D41519549 fbshipit-source-id: a64e3ef73bb0df691cf9d2cde8f340aac75ac009
Summary: Pull Request resolved: #35456 Fixes #35439 There is a bug in AGP 7.3.x which is causing assets to don't be copied properly inside the final artifact: issuetracker.google.com/issues/237421684 As AGP 7.4.x is really close to release (is in Beta5, should be released stable in the next weeks) we should be fine by bumping to beta5. This also requires a bump of RNGP Changelog: [Android] [Changed] - Bump AGP to 7.4.x allow-large-files Reviewed By: cipolleschi Differential Revision: D41519549 fbshipit-source-id: 60d568a3e49798a23f1d7bf4839ab58bd5549aba
@louiszawadzki can you try out RC3? It has the bump to AGP 7.4 beta so the problem should be addressed |
Summary: Pull Request resolved: facebook#35456 Fixes facebook#35439 There is a bug in AGP 7.3.x which is causing assets to don't be copied properly inside the final artifact: issuetracker.google.com/issues/237421684 As AGP 7.4.x is really close to release (is in Beta5, should be released stable in the next weeks) we should be fine by bumping to beta5. This also requires a bump of RNGP Changelog: [Android] [Changed] - Bump AGP to 7.4.x allow-large-files Reviewed By: cipolleschi Differential Revision: D41519549 fbshipit-source-id: 60d568a3e49798a23f1d7bf4839ab58bd5549aba
Description
Static images (like the logo in the header of a newly generated application) are not rendered on Android in 0.71.0-rc.0.
Cause of the bug
I've done a bit of investigation, here is what I found:
In the react-native-gradle-plugin, we use
variant.sources.res?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::resourcesDir)
which changes theresourcesDir
of thebundleTask
toRES/createBundleReleaseJsAndAssets
: https://android.googlesource.com/platform/tools/base/+blame/186d0522f7fc1f02e33c197f40a5b7ce8834f110/build-system/gradle-core/src/main/java/com/android/build/api/variant/impl/SourceDirectoriesImpl.kt#54There has been a fix applied in android-gradle-plugin version 7.4.0-beta05, so the new path is then
generates/res/createBundleReleaseJsAndAssets
, and with this version I can see the image 🥳.So one solution is to wait for android-gradle-plugin version 7.4.0 to be released.
However, resources won't be in "generated/res/react/Release" which is the path specified in the react-native-gradle-plugin, I think this can be misleading.
This path should be changed as well, or the resources should be copied over to that directory as well, as what used to be done with
react.gradle
.This is exactly the same cause as #35398.
Version
0.71.0-rc.0
Output of
npx react-native info
Steps to reproduce
npx react-native init <YourAppName> --version 0.71.0-rc.0
maven-local.zip
on a folder on your disk.REACT_NATIVE_MAVEN_LOCAL_REPO=<path_to_the_maven-local_unzipped_folder>
setting to the android/gradle.properties fileyarn android --variant=release
Snack, code example, screenshot, or link to a repository
With
"com.android.tools.build:gradle:7.3.1"
:With
"com.android.tools.build:gradle:7.4.0-beta05"
:The text was updated successfully, but these errors were encountered: