Game crashes on user's devices (SOLVED)

Hmm, I remembered that this bug was fixed, but there is again null pointer in iap module:
java.lang.NullPointerException
com.defold.iap.IapGooglePlayActivity.onCreate
All 8 crashes on Android 5.0
Engine ver: 1.2.141

LGE LG Prime Plus 4G (mc90ds), Android 5.0
Report 1 from 8

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2331)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2391)
  at android.app.ActivityThread.access$800 (ActivityThread.java:151)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1309)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:135)
  at android.app.ActivityThread.main (ActivityThread.java:5354)
  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:908)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:703)
Caused by: java.lang.NullPointerException: 
  at com.defold.iap.IapGooglePlayActivity.onCreate (IapGooglePlayActivity.java:223)
  at android.app.Activity.performCreate (Activity.java:6021)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1105)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2284)
4 Likes

Yes, that issue should be fixed in the next release (1.2.142) (DEF-3585)

5 Likes

Released in 1.2.142

1 Like

engine version 1.2.144

java.lang.IllegalArgumentException
com.dynamo.android.DefoldActivity.onCreate

Wiko FEVER (l5460), Android 6.0
1 / 2

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2572)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2654)
  at android.app.ActivityThread.-wrap11 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1488)
  at android.os.Handler.dispatchMessage (Handler.java:111)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:5728)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
Caused by: java.lang.IllegalArgumentException: 
  at android.app.NativeActivity.onCreate (NativeActivity.java:170)
  at com.dynamo.android.DefoldActivity.onCreate (DefoldActivity.java:205)
  at android.app.Activity.performCreate (Activity.java:6376)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1113)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2519)
1 Like

I have the same crashes in the game without NEs (Solitaire)


1 Like

I don’t have source code access at the moment but @Johan_Beck-Noren should be able to check tomorrow what changes (if any) could cause this problem.

Anything in particular about the devices? Android OS versions?

In my both my cases it was Android 6.0 (ZTE BLADE V7 (P653A10) and Cubot MAX (x6069_cubot_5365u))

UPD:
Looks like android 6 can’t find libname path for some reason https://android.googlesource.com/platform/frameworks/base/+/android-cts-6.0_r32/core/java/android/app/NativeActivity.java#170

1 Like

Wiko FEVER (l5460), Android 6.0

Thanks. Added DEF-3688 to our sprint planning today.

4 Likes

Hmm, strange crash is catched

java.lang.ArrayIndexOutOfBoundsException
com.dynamo.android.DefoldActivity$1.run
in Google Play Services, but game don not use gms extension.

Also, what is “ProGuard deobfuscation file”? Is it possible to build this one with Defold?

We get advertising info at start on Android so that we can populate some of the fields in sys.get_sys_info(). The code looks like this:

    new Thread(new Runnable() {
        public void run() {
            try {
                AdvertisingIdClient.Info info = AdvertisingIdClient.getAdvertisingIdInfo(self);
                self.setAdInfo(info.getId(), info.isLimitAdTrackingEnabled());
            } catch (java.io.IOException e) {
                self.setAdInfo("", false);
            } catch (GooglePlayServicesNotAvailableException e) {
                self.setAdInfo("", false);
            } catch (GooglePlayServicesRepairableException e) {
                self.setAdInfo("", false);
            }
        }
    }).start();

It seems like it’s crashing somewhere inside the GPS code. We should probably do a generic try-catch just to make sure we catch everything. Created DEF-3692.

ProGuard is a tool for obfuscating and/or minimising Java code. We do not use it but it’s in our roadmap to add support for it (or the new R8 tool from Google) to reduce APK size.

4 Likes

After some investigation this is probably caused by the device looking for a (non-existent) 64-bit engine lib in the APK. Looking at the chipsets on affected devices, they should support the lib we currently ship (armeabi-v7a) but for some reason they don’t.

Instead of digging more into this specific issue we decided to start work on DEF-3459 adding Android 64-bit support. It’s on our roadmap for 2019 and is due anyway. Once in place, it should solve the issue in this thread as well.

7 Likes

Solved in 1.2.145

1 Like

Solved in 1.2.153

Should work fine in 1.2.153 (if you include Android 64bit)

1 Like

I just uploaded a new build (made bundle in 1.2.154, 32 and 64-bit) into the Google Store, so, will collect a new statistic.

5 Likes

Found new crash reports in Google Console for this build. May be interesting:

28 May 22:15 on app version 67
Huawei Honor 10 (HWCOL), Android 9
Report 1 of 3

java.lang.NullPointerException: 
  at com.defold.iap.IapGooglePlay.handleMessage (IapGooglePlay.java:476)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:7470)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:958)

Other reports are available here (with build.zip files for this release):
https://drive.google.com/drive/folders/19VjTFMiJPvcPLZTB03jrL4yNJbaQp6w3?usp=sharing

2 Likes

I’ve made a bundle with default minimum Android SDK version (16) in last update and have ~70 crashes with 11 impacted users with an old devices:

Android 4.4 63 90.0%
Android 4.2 7 10.0%
A536 (A536) 17 24.3%
Galaxy Tab E 9.6 (gtel3g) 10 14.3%
Galaxy Tab3 Lite 7.0 (goyavewifi) 9 12.9%
HT7071MG 8 11.4%
Galaxy Tab2 7.0 (espressorf) 7 10.0%
Galaxy S3 Neo (s3ve3gds) 5 7.1%
Galaxy S4 Mini (serrano3g) 4 5.7%
Galaxy Tab Pro 10.1 (picassowifi) 4 5.7%
Unite 3 (Q379) 3 4.3%
Hol-U10 (HWHol-U) 2 2.9%
Galaxy Core Prime (core33g) 1 1.4%

java.lang.ClassNotFoundException
dalvik.system.BaseDexClassLoader.findClass

Today, 17:12 on app version 78
Samsung Galaxy Tab2 7.0 (espressorf), Android 4.2
Report 1

java.lang.RuntimeException: 
  at android.app.LoadedApk.makeApplication (LoadedApk.java:504)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4525)
  at android.app.ActivityThread.access$1400 (ActivityThread.java:150)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1340)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:137)
  at android.app.ActivityThread.main (ActivityThread.java:5279)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1102)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:869)
  at dalvik.system.NativeStart.main (Native Method)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:65)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:501)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:461)
  at android.app.Instrumentation.newApplication (Instrumentation.java:985)
  at android.app.LoadedApk.makeApplication (LoadedApk.java:499)

As I understand 4.2 Android (17 SDK) should work, what can be wrong?
Previosly I bundled with 14 minimum SDK.

Does it say what class it cannot load?

Google console? nope, it doesn’t show this important info.

1 Like

We will investigate and see if we see similar issues in King games. @AGulev have you seen this in your games?