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
[0.57][ANDROID] Signed release do not show local assets images. #21309
Comments
I was able to solve the problem by manually running However, why was copying images to their respective asset folders not required before? |
I can't, after execute that command i get the duplicated assets error, and if i don't remove the assets moved to the res folder the application won't run :/ Probably will just need to downgrade just to make the signed APK. |
I have this exact same issue. I end up manually removing the images from This isnt ideal as its a bit of manual work each time I need to build an apk |
Same issue here. What @ygerg suggested does work, but I am wondering why this is. |
@ygerg solution didn't worked for me. To make the build I had to rollback the |
I tried almost all possible solutions and the images still don't show after a successful build. For the moment i uploaded all images to the server and i'm using the url to load them but gonna have to downgrade to generate my final release if i can't find a solution that works :C |
iOS is from |
what is
|
I changed
to
in error was changed.
|
@shinriyo That is a completely separate issue, in order to update to 0.57 you need to first run Then, change {
"presets": ["module:metro-react-native-babel-preset"]
} |
@ygerg thank you for response |
Finally I don't know what is bad, but worked
And I ran |
Faced the same problem after upgrading to React Native 0.57 on Android (iOS seems to be working fine) Here's what I did:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android && ./gradlew assembleRelease
git clean -fd make sure you have committed your code before running the This will create the release apk with all the required local images. However, a fix for the usual way will be really appreciated... |
Yeah, it broke our Android build. Copying the assets over manually leaves the project unclean. Hope there will be a fix soon. Any idea which commit in 0.57 introduced this issue? Just so that we can think about a real fix. |
Upgrading gradle version to 4.4 actually fixes this issue. Steps available in this documentation |
Actually i upgraded gradle to 4.4 coz im also using rnfirebase but had no luck. The only solution i found is transform all my image assets to base64 literals and import them as string variables. |
@DaniAkash how do you write path to images to make it work with 4.4 gradle? |
I found right way for Android.
For iOS it is a bit simplier, you just copy assets and use I think, issue may be closed. EDIT. Example of my task plased in
And requiring that image:
|
Unfortunately problem still exists in react-native 0.57.7 |
I've upgraded my react native to 57.7
from gradle.properties remove android.enableAapt2=false #use the following command to bundle assets:
now generate release apk using following command.
|
Any progress on this issue or any solution available, I'm also facing the same issue. Unfortunately, for me, it's on the landing page and happening only when I install the APK and immediately launch the application.(if I open application for next time, images are getting load/render) |
Any fix/temporary solution for this ? 😕 I tried Here's my env:
|
Dirty fix: Transform images to base64 and import them as js files |
Hello there 👋 this issue has been reported for an old version of React Native. Ideally we'd like everyone to be using 0.59 (see the awesome changes it brought) but we know updating can be a pain. We are going to close this issue because it's from a version before 0.57, which is really old. But please, if it's actually still an issue with 0.59 please comment below and we can reopen it 😊 |
I am using the 0.59 version but I am still facing this issue |
I am using the 0.59.6 and I am have this issue |
I have the same issue for more than 2 years! why nobody can find a solution!!!? none of the provided solutions is working permanently! |
I also had this issue, but I can’t exactly remember how I fixed it. I think I upgraded the Gradle version and compared the .gradle files to the files of a brand new project generated by react-native-cli. |
Manually create a bundle(react-native bundle command) and comment this line "../../node_modules/react-native/react.gradle" from android/app/build.gradle file. If you face any issue like index.js/index.android.js not found give, the absolute path(for linux - /home/{user}/project-dir) of index.js file and output file. |
0.59.8 still same issue.. |
somehow I fixed the issue and I don't remember how a few months back when I upgraded to .59.1 then slowly the project fine till 0.59.8. Yesterday, I upgraded to 0.59.9 and this issue came up. :( .. look like this could be linked to gradle properties. |
I have recently upgraded to 0.59.9 and experienced this the first time. I followed @ygerg advice: Then I got a 'duplicate assests error' and followed @anjapadu advice to remove the assets from android\app\src\main\res (there was a new 'drawable-mdpi' folder which I removed). Problem seems to be solved this way, but I don't understand: why do I get the |
Delete all drawable folder from your res folder then run ./gradlew assebleRelease command.. this will work |
@SimaRajput I think that you misunderstood me... I know how to make it work, I just asked a question... |
Using 0.59.5 and also getting this problem. I've tried to fix it with the suggested
I would expect that Nevermind: I had a script that helpfully deleted all these resources that I had generated :P |
Set
|
This is actually worked. use {uri: "asset:/file_name.png"} Well, I don't have much time to spend for 1 local image only, may as well do things dirty to make time more efficient. Either way, this worked for me. |
change build.grandle |
Also seeing this issue.. |
Environment
Description
Debug is all alright. After build release apk version can't see local images.
Tried the #20358 workaround but get this error:
on al my resources of all my images. Any ideas? Maybe could be the bundle?
Reproducible Demo
Just release build android signed release.
Gradle 4.4.1
The text was updated successfully, but these errors were encountered: