react-native-image-viewer
react-native-image-viewer copied to clipboard
ANDROID: App crash after trying to load image
I'm trying to use it on android it's trying to load the images, but it doesn't show up anything and after sometime app crashes.
Please @GrishmaM send more information about your device/emulator and your React Native version in order to improve this issue report
Hi @luisrivas , I have the same issue. Below is the information of the bug.
Device:
- real device Samsung J3 (year 2016) (Android 5.1.1) React native version:
- 0.59.9 React-native-image-viewer version:
- 2.2.26
Below is the error code
More error code: 08-07 20:31:29.952 28808-28847/com.imageviewer E/OpenGLRenderer: Could not allocate texture for layer (fbo=2 720x1230) 08-07 20:31:29.952 28808-28847/com.imageviewer D/OpenGLRenderer: Current memory usage / total memory usage (bytes): TextureCache 0 / 25165824 LayerCache 0 / 16777216 (numLayers = 2) Layer size 0x0; isTextureLayer()=0; texid=3 fbo=0; refs=1 Layer size 0x0; isTextureLayer()=0; texid=2 fbo=0; refs=1 Layers total 0 (numLayers = 2) RenderBufferCache 0 / 2097152 GradientCache 0 / 524288 PathCache 0 / 10485760 TessellationCache 0 / 1048576 TextDropShadowCache 0 / 2097152 PatchCache 0 / 131072 FontRenderer 0 A8 524288 / 524288 FontRenderer 0 RGBA 0 / 0 FontRenderer 0 total 524288 / 524288 Other: FboCache 2 / 16 Total memory usage: 524288 bytes, 0.50 MB 08-07 20:31:29.952 28808-28847/com.imageviewer E/OpenGLRenderer: Could not allocate texture for layer (fbo=2 720x1230) 08-07 20:31:29.952 28808-28847/com.imageviewer D/OpenGLRenderer: Current memory usage / total memory usage (bytes): TextureCache 0 / 25165824 LayerCache 0 / 16777216 (numLayers = 2) Layer size 0x0; isTextureLayer()=0; texid=3 fbo=0; refs=1 Layer size 0x0; isTextureLayer()=0; texid=2 fbo=0; refs=1 Layers total 0 (numLayers = 2) RenderBufferCache 0 / 2097152 GradientCache 0 / 524288 PathCache 0 / 10485760 TessellationCache 0 / 1048576 TextDropShadowCache 0 / 2097152 PatchCache 0 / 131072 FontRenderer 0 A8 524288 / 524288 FontRenderer 0 RGBA 0 / 0 FontRenderer 0 total 524288 / 524288 Other: FboCache 2 / 16 Total memory usage: 524288 bytes, 0.50 MB 08-07 20:31:29.952 28808-28808/com.imageviewer W/JNIHelp: Discarding pending exception (java.lang.IllegalStateException: Unable to create layer for ReactViewGroup) to throw java/lang/IllegalStateException 08-07 20:31:29.952 28808-28808/com.imageviewer D/AndroidRuntime: Shutting down VM 08-07 20:31:29.952 28808-28808/com.imageviewer E/AndroidRuntime: FATAL EXCEPTION: main Process: com.imageviewer, PID: 28808 java.lang.IllegalStateException: Unable to create layer for ReactViewGroup at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:143) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:7007) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 08-07 20:31:29.962 28808-28847/com.imageviewer E/OpenGLRenderer: GL error: GL_INVALID_OPERATION
Hope it can help
Hello 👋 , I have the same issue too. Any update?
Same problem here, with same version of Android : 5.1.1
Same problem here. 160 crashes for 25 users. 100% are Samsung devices with Android 5.1.1. Very often with a Galaxy J3(2016).
Fatal Exception: java.lang.IllegalStateException: Unable to create layer for ReactViewGroup
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:7007)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Can fix android
- application android:hardwareAccelerated="false"
but not animate not smooth but is working
ref : https://stackoverflow.com/questions/13850259/is-there-a-way-to-disable-hardware-acceleration-only-for-android-4-0-3
like this
<Modal visible={true} transparent={true}>
<ImageViewer imageUrls={images}/>
</Modal>
attention style