Expo vers 26 crash on standalone Android, help to debug

#1

When building standalone app on Android I get two crashes during startup after upgrading to Expo ver. 26.
Thankful for tips on how this can be debugged/solved

Both crashes generates blue screen with message:
Attempt to invoke method ‘int java.lang.String.hashCode()’ on a null object reference

adb logcat crash 1:
--------- beginning of crash
04-01 18:49:38.444 31343 31343 E AndroidRuntime: FATAL EXCEPTION: main
04-01 18:49:38.444 31343 31343 E AndroidRuntime: Process: com.test.test, PID: 31343
04-01 18:49:38.444 31343 31343 E AndroidRuntime: java.lang.RuntimeException: com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be a Bitmap.
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.bridge.ReactContext.handleException(ReactContext.java:313)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:33)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:136)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:723)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:655)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:790)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6494)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: Caused by: com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be a Bitmap.
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.maps.api.android.lib6.impl.n.a(com.google.android.gms.DynamiteModulesB@12221440@12.2.21 (440-188803320):12)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.maps.api.android.lib6.impl.o.a(com.google.android.gms.DynamiteModulesB@12221440@12.2.21 (440-188803320):7)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.maps.api.android.lib6.impl.db.(com.google.android.gms.DynamiteModulesB@12221440@12.2.21 (440-188803320):25)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.maps.api.android.lib6.impl.bc.a(com.google.android.gms.DynamiteModulesB@12221440@12.2.21 (440-188803320):496)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.android.gms.maps.internal.l.onTransact(com.google.android.gms.DynamiteModulesB@12221440@12.2.21 (440-188803320):94)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at android.os.Binder.transact(Binder.java:627)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.android.gms.maps.a.b$a$a.a(Unknown Source:28)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at com.google.android.gms.maps.c.a(Unknown Source:2)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.host.exp.exponent.modules.api.components.maps.AirMapMarker.addToMap(AirMapMarker.java:297)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.host.exp.exponent.modules.api.components.maps.AirMapView.addFeature(AirMapView.java:481)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.host.exp.exponent.modules.api.components.maps.AirMapManager.addView(AirMapManager.java:350)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.host.exp.exponent.modules.api.components.maps.AirMapManager.addView(AirMapManager.java:27)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:311)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:180)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:822)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:929)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.UIViewOperationQueue.access$2100(UIViewOperationQueue.java:47)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:989)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: at abi26_0_0.com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
04-01 18:49:38.444 31343 31343 E AndroidRuntime: … 13 more

adb logcat crash 2:
--------- beginning of crash
04-09 07:29:19.034 6646 8355 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 8355 (RenderThread), pid 6646 (stagram.android)
04-09 07:29:19.203 22900 22900 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-09 07:29:19.204 22900 22900 F DEBUG : Build fingerprint: ‘google/bullhead/bullhead:8.1.0/OPM3.171019.016/4565142:user/release-keys’
04-09 07:29:19.204 22900 22900 F DEBUG : Revision: ‘rev_1.0’
04-09 07:29:19.204 22900 22900 F DEBUG : ABI: ‘arm’
04-09 07:29:19.204 22900 22900 F DEBUG : pid: 6646, tid: 8355, name: RenderThread >>> com.instagram.android <<<
04-09 07:29:19.204 22900 22900 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-09 07:29:19.216 22900 22900 F DEBUG : Abort message: ‘Failed to create EGLSurface for window 0xccddf008, eglErr = EGL_BAD_ALLOC’
04-09 07:29:19.216 22900 22900 F DEBUG : r0 00000000 r1 000020a3 r2 00000006 r3 00000008
04-09 07:29:19.216 22900 22900 F DEBUG : r4 000019f6 r5 000020a3 r6 cf1f03c4 r7 0000010c
04-09 07:29:19.216 22900 22900 F DEBUG : r8 00000000 r9 cf1f08c8 sl ede0a538 fp 00000000
04-09 07:29:19.216 22900 22900 F DEBUG : ip ccddf000 sp cf1f03b0 lr ee1b78b1 pc ee1b139a cpsr 200f0030
04-09 07:29:19.356 22900 22900 F DEBUG :
04-09 07:29:19.356 22900 22900 F DEBUG : backtrace:
04-09 07:29:19.356 22900 22900 F DEBUG : #00 pc 0001a39a /system/lib/libc.so (abort+63)
04-09 07:29:19.356 22900 22900 F DEBUG : #01 pc 0000655d /system/lib/liblog.so (__android_log_assert+156)
04-09 07:29:19.357 22900 22900 F DEBUG : #02 pc 0004ce59 /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+196)
04-09 07:29:19.357 22900 22900 F DEBUG : #03 pc 0004b3e5 /system/lib/libhwui.so (android::uirenderer::renderthread::OpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode)+42)
04-09 07:29:19.357 22900 22900 F DEBUG : #04 pc 00048d5f /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::Surface*)+62)
04-09 07:29:19.357 22900 22900 F DEBUG : #05 pc 0004f161 /system/lib/libhwui.so (android::uirenderer::renderthread::Bridge_initialize(android::uirenderer::renderthread::initializeArgs*)+8)
04-09 07:29:19.357 22900 22900 F DEBUG : #06 pc 000500db /system/lib/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+10)
04-09 07:29:19.357 22900 22900 F DEBUG : #07 pc 00050fab /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+178)
04-09 07:29:19.357 22900 22900 F DEBUG : #08 pc 0000d131 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+144)
04-09 07:29:19.357 22900 22900 F DEBUG : #09 pc 0006dc49 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+80)
04-09 07:29:19.357 22900 22900 F DEBUG : #10 pc 000474ff /system/lib/libc.so (__pthread_start(void*)+22)
04-09 07:29:19.357 22900 22900 F DEBUG : #11 pc 0001af69 /system/lib/libc.so (__start_thread+32)

#2

Does your app work with the non minified version? My crashes too but only with the minified version.

#3

I build with exp build:android
Then install via adb. So I am not sure if minified or not. Is it possible to configure?

#4

Yes I think it is minified. Try testing with exp start --minify and exp start and see if it always works.

#5

Thanks, Yes both exp start and exp start --minify works fine. I only get the crash when running standalone build on Android. Testing on Nexus 5X device, Android release 8.1.0…

#6

Having the same issue in standalone app. Testing on Nexus 6P Android 8.1. I’m pretty sure that is because of Google Maps API.

#7

Hi - could you provide some code that repros this crash? I know it’s a standalone only issue, but maybe a snack with enough code to reproduce this if I built a standalone app with it? That would be super helpful in trying to track down the root cause. Thanks so much!

1 Like
#8

Here is a code sample to reproduce the error: https://snack.expo.io/@spierr/errorsample.

Please note that in order to compile the apk for android is necessary to create an api key as explained in the next link: https://docs.expo.io/versions/latest/sdk/map-view

Thanks!

#10

I had two crashes.
Crash 2 is solved. It was related to expo push notifications. I think the reason for the crash was that I used Permissions.askAsync on Android. (Worked in previous versions of Expo)

Crash 1. Crash happens when adding custom marker image to MapView. I use png format images. Worked fine with previous versions on Expo. Is it possible to covert to bitmap?

adb logcat:
FATAL EXCEPTION: main
04-14 18:40:14.357 4805 4805 E AndroidRuntime: Process: com.NeighborWatch.NeighborWatch, PID: 4805
04-14 18:40:14.357 4805 4805 E AndroidRuntime: java.lang.RuntimeException: com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be a Bitmap.

I use the following code:
import orangeMarkerImg from ‘…/assets/images/markers/48/orange.png’
<MapView.Marker
key={i}
title=“Hello there”
coordinate={{
latitude: parseFloat(venue.lat),
longitude: parseFloat(venue.lng),
}}
image={orangeMarkerImg}
/>

#11

I am having the same exact issue here with mapview marker after upgrading to expo 26 standalone android app crashes and logs:
java.lang.RuntimeException: com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be a Bitmap.

Any solution to this yet?

2 Likes
#12

Hi all - SDK 27 is slated to include react-native-maps@0.21.0 which I believe should fix this issue. If you’re experiencing this crash, I would recommend just staying on your current SDK version until 27 is out and upgrading at that point. If you upgrade to 27 and you’re still getting this same crash, let us know.

Be sure to follow our blog, as we’ll announce there when 27 is out.

#13

I’m also experiencing this. Same exact error in Fabric. Is it possible to push out a hotfix for SDK 26?

2 Likes
#14

Our standalone app still crashes, after upgrading the build to SDK 27.

1 Like
#15

Still crash with standalone app (SDK 27). Crash when adding image for markers.

JSApplicationIllegalArgumentException: Error while updating property ‘image’ of a view managed by: AIRMapMarker

2 Likes
#16

It doesn’t look like SDK 27 actually got react-native-maps@0.21.0 - that’s not a tag that exists on the expo/react-native-maps repo. Is there a way we can release this now before 28?

1 Like
#17

I can’t speak about the specific crash this thread covers, but we did import rn-maps after the 0.21.0 version bump for SDK 27. (I don’t know if they tagged it upstream.)

closed #18

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.