react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Android] Old Image from Drawable No Longer Working after Upgrading to 0.14.2

Open krxsky opened this issue 11 years ago • 7 comments

I recently upgraded to 0.14.2. I was using the old way to handle images with res/drawable on Android and the image asset system on iOS. After the upgrade, the iOS images still works as before but on Android, an error shows up with the red screen saying Requiring unknown module "image!ic_refresh_white_24dp". If you are sure the module is there, try restarting the packager

Is this intended to happen? I was under the impression that the old way of handling images would still work. Thanks!

krxsky avatar Nov 19 '15 17:11 krxsky

Also experiencing this one, we had to roll back again to version 13.+.

lawgimenez avatar Nov 20 '15 01:11 lawgimenez

You need to change the require('image!your_drawable') with { uri: 'your_drawable' } in the image or component you want to get the resource.

sarriaroman avatar Nov 20 '15 14:11 sarriaroman

Is there any documentation about this change?

lawgimenez avatar Nov 24 '15 04:11 lawgimenez

@lawgimenez Try taking a look at the new asset system that was introduced in 0.14. More info can be found here. https://facebook.github.io/react-native/docs/images.html#content

christopherdro avatar Nov 24 '15 10:11 christopherdro

@krxsky does @christopherdro's answer satisfy your original issue?

skevy avatar Nov 24 '15 17:11 skevy

@skevy Sorry, I hadn't had time to try it lately. I was using the images for ToolbarAndroid's icons, but I replaced the Toolbar all together to share more code with the iOS side. That said, I believe the documentation for ToolbarAndroid's examples should be updated. They are still using the outdated way for all the examples.

krxsky avatar Nov 24 '15 18:11 krxsky

@krxsky I'm closing this issue for now as there are too many reports regarding the same issue. And the docs have been updated too.

satya164 avatar Nov 30 '15 02:11 satya164