Android standalone doesn't load images
See original GitHub issueHey everyone, I’ve been stuck on an android standalone build issue for a couple days now. Would really appreciate any tips. I’ve read through all the similar issue reports but those fixes don’t seem to help anymore.
This is how I’ve been loading assets (works fine in Expo and iOS standalone)
this.backgroundTexture = await ExpoTHREE.loadAsync(Asset.fromModule(require('../assets/textures/white_marble.png')));
On android standalone, the image just shows up blank. App doesn’t crash though, like other devs reported in 2019.
I also tried:
this.backgroundTexture = await ExpoTHREE.loadAsync("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png");
but no luck! Url also doesn’t load.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Picasso: Image doesn't load when I add NetworkPolicy. ...
The code works fine when I am online. When I add .networkPolicy(NetworkPolicy.OFFLINE) to display the image offline the image doesn't show at ...
Read more >How to Fix Images Not Loading in Chrome
When Chrome doesn't display images on a site, switch to another web browser on your computer and see if you can load the...
Read more >Why Can't I See My Pictures in My Gallery, How to Fix?
Part 1. Why Android Gallery Not Showing Pictures? · The images are saved as .nomedia file · The caches cause the issue.
Read more >Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >[expo-gl][Android][standalone] gl.texImage2D doesn't ...
In Android standalone app asset resolves to local uri with protocol asset:// and gl.texImage2D(...) doesn't render image for such uri. I assume that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran in to this issue as well in Android release variants. What ended up working for me is [this modification] - change the extension of the image to
.xpng
(otherwise on Android, it gets moved to thedrawables
folder instead ofraw
, and expo loader expects them inraw
.With this change in place, the following code should work (using your example above):
you should then be able to use
tex
with any material. This change also works with iOS too, so you don’t need any platform specific logic.There are a few issues filed with the main
expo/expo
repo related to this so hopefully is a temporary workaround.I’m not sure how much I will be able to help with that error. I don’t have any experience with debugging Android - I only found the trick with changing extensions for images after many hours of searching and it worked for me so I thought I would share. In your
adb logcat
I noticelibexpo-gl.so not found on /data/data/com.jackz_sparoow.SampleApp/lib-main
and that seems like it could be related. If your app can’t load libexpo-gl or doesn’t have it linked you would have a lot of problems with texture loading. But again I have very little experience with debugging these sorts of problems.