I am using react native version
react-native-cli: 1.0.0
react-native: 0.27.2
I have already asked question on StackOverflow but it is not working for me. Let me know how to resolve this issue
Thanks
@facebook-github-bot ?
@facebook-github-bot-0 @facebook-github-bot-1 @facebook-github-bot-2 @facebook-github-bot-3 ?
Check ${project}/android/app/src/res , if imgs not in there , maybe you should manually run this command in project root to copy imgs:
react-native bundle --platform android --dev false --entry-file index.android.js \
--bundle-output android/app/src/main/assets/index.android.bundle \
--assets-dest android/app/src/main/res/
${project}/android/app/src/res? i am using react-native 0.27.2. and it is not required anymore to put images over there. I am requiring it directly where i have js files. In development it is showing absolutely fine but in production, it is just blank
<Image source={require("../assets/[email protected]")} />
wherever you require your img files, when releasing apk android copy resource from res/ directory, why not to try this first?
Thanks @231907786, Finally your solution works for me. Thanks a lot. So there is a bug in react-native 0.27.2 version. We have to run this command manually to bundle assets in released.apk file.
Thanks again :)
@231907786 I have no word how I say thanks but thank you. I got stuck in this issue from last 8 days and hopes were getting died.I have left no medium where i have not asked this question but none answer worked for me .Finally you and you who help me to solve this. Thank you so much 👍 :)
I have the same issue, but the images are already there and I did run the command to make sure, the images are not showing.
Some of the images are showing, some of them are not.
react-native-cli: 1.0.0
react-native: 0.31.0
@mdibaiee I haven't met this, may you can try copy images manually:
assume now at project root, having an image located at js/assets/pic.png , you can rename to js-assets-pic.png and copy to android/app/src/main/res/drawable-mdpi/, then in your release apk you can see it.
@231907786 The files are already there, but the naming convention is different from what you said:
assets/images/setup-info-full.png -> assets_images_setupinfofull.png
The weird fact is some of the images show up, some others do not, I'm not sure why.
@mdibaiee Have you changed the file extension by hand? If do this, the image won't be shown in release, try check this?
@231907786 you mean the names include .png but they actually are not PNGs? nope.
I just checked all the files and they're all actually pngs using (file command on linux). Also, they work in development, I wonder why.
I'm having the same issue as @mdibaiee, rn v .31
@mdibaiee, my issue was the image size. I had a large local .png and was trying to resize to a small thumbnail and it would't show. iOS handles it, Android didn't.
Thank you @parkerdan
I had a perfectly working Android app, made a iOS version, went back to android to do an update and suddenly my logo image does not work.
Turns out I moved to a very large image for higher screen densities but I did not suspect it because I thought both have image scaling out of the box.
Does anyone reading this know where we can find the correct maximum resolution we can use for android (specifically the navbar)
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.
I have the same issue.
I am using react native version
"react": "16.0.0-alpha.12",
"react-dom": "16.0.0-alpha.12",
"react-native": "^0.50",
And I've checked ${project} / android / app / src / res,run react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
The picture appears in the drawable folder.But release.apk does not showing images.What should i do?
@WangJian0 建议排查一下你的android工程配置,app/build.gradle ,minifyEnabled和shrinkResources这两个参数,如果你的图片只是在js文件中使用url或者require方式引用,那么在gradle编译的时候很有几率会把这些图标被优化成1*1的黑色图片。
any luck for this issue ??
Please let me know the image size.
I think that this causes because of too large image size.
Please resize the image and test again
Most helpful comment
Check ${project}/android/app/src/res , if imgs not in there , maybe you should manually run this command in project root to copy imgs:
react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/