ExpoKit update from 25 to 26 Android crash

#1

Hi!

I’m using detached Expo at version 25. I’ve followed Expo SDK + ExpoKit 25 => 26 update steps and managed to get iOS version working without any issue. But there is a problem with Android, which is throws a runtime exception.

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

I’ve just update Android Studio to version 3.1.2, as well as Gradle to version 4.4.

I’ve managed to catch following log using adb logcat, but don’t know how to fix it

05-10 13:11:14.023 15618 15618 E ViewRootImpl@82e0a0[MainActivity]: ViewRootImpl #2 Surface is not valid.
05-10 13:11:14.024 26528 16375 V FA-SVC  : Upload scheduled in approximately ms: 2566866
05-10 13:11:14.025  2999  4006 D SamsungAlarmManager: Cancel Alarm calling from uid:10021 pid :26528 / op:PendingIntent{102b76c: PendingIntentRecord{7c3fe06 com.google.android.gms $
roadcastIntent}}
05-10 13:11:14.026 26528 16375 V FA-SVC  : Cancelling job. JobID: 812057698
05-10 13:11:14.030 26528 16375 V FA-SVC  : Scheduling upload with GcmTaskService
05-10 13:11:14.030 26528 16375 V FA-SVC  : Scheduling task with Gcm. time: 2566866
05-10 13:11:14.032 15618 15618 D ViewRootImpl@ef6d51[ErrorActivity]: mHardwareRenderer.destroy()#1
05-10 13:11:14.033  2999  3973 V WindowManager: Relayout Window{a35087bd0 u0 myProjectSlug/host.exp.exponent.experience.ErrorActivity}: viewVisibility=8 req=720x1280 $
M.LayoutParams{(0,0)(fillxfill) sim=#120 ty=1 fl=#85810100 pfl=0x20000 wanim=0x1030465 vsysui=0x700 needsMenuKey=2 naviIconColor=0}
05-10 13:11:14.036 26528 16375 V FA-SVC  : Background event processing time, ms: 68
05-10 13:11:14.038 15618 15618 D ViewRootImpl@ef6d51[ErrorActivity]: Relayout returned: oldFrame=[0,0][720,1280] newFrame=[0,0][720,1280] result=0x5 surface={isValid=false 0} surfa$
eGenerationChanged=true
05-10 13:11:14.047 15618 15618 V FA      : onActivityCreated
05-10 13:11:14.052  2999 25987 D LocationManagerService: getProviders()=[]
05-10 13:11:14.055  2999  3487 D SamsungAlarmManager: Cancel Alarm calling from uid:10021 pid :26485 / op:PendingIntent{b933135: PendingIntentRecord{a0d77cc com.google.android.gms $
roadcastIntent}}
05-10 13:11:14.065 15618 15618 E ErrorActivity: ErrorActivity message: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null ob$
ect reference
05-10 13:11:14.069  2999  3981 D SamsungAlarmManager: setInexact Intent (T:2/F:0/AC:false) 20180510T132400 - CU:10021/CP:26485
05-10 13:11:14.080 15618 16374 V FA      : Activity resumed, time: 705770029
05-10 13:11:14.084 15618 15618 D ViewRootImpl@3feabeb[ErrorActivity]: ThreadedRenderer.create() translucent=false
05-10 13:11:14.086  2999  3975 D WindowManager: addWindow: android.view.IWindow$Stub$Proxy@aa849ca displayId=0

Any ideas?

1 Like
#2

Had to recreate + detach whole project from scratch with SDK 27, as there seemed to be no other way to resolve this.

1 Like
#3

Did that end up resolving your problem? I’m sorry you had to experience this.

#4

No, had to migrate to fresh SDK 27 project. No worries, despite this, Expo still brings a lot of value.

1 Like
#5

Have the same issue moving from 26 to 27.

and I’m kind of stuck… It’s annoying to spend so much time trying to figure out what’s wrong with the ecosystem and so little to actually work on our code :confused:

1 Like
#6

I’m having the same issue upgrading to ExpoKit 27, java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

1 Like
closed #7

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