java.lang.ClassNotFoundException

Hi,

in the last few days, my Android Game is throwing a ClassNotFoundException. There is no classname in the Exception, so i don’t have ideas for solving the bug. The user who is testing the game is in another country, so I don’t have physical access to the device.

Any Hints for resolving this are welcome!

Well, we need more info.
Can you get the logs from the user?
Are you using any native extensions? (I.e. What dependencies do you have?)

Any other info you can provide would be helpful:

1 Like

I will try to get the log from the user. In my device the problem does not occur. I am trying to get a similar device and the write the full report.

Greetings

Are you? This is important.

1 Like

And this

That version of the game with the problem use deffx and defblend. (https://github.com/subsoap/deffx/archive/master.zip and https://github.com/subsoap/defblend/archive/master.zip).

Hmm, not sure what could be the problem. It would be good if you could reproduce it. Do you know when it happens? On startup? Or while playing? Or when a specific thing happens?

I will try to reproduce the error by myself. The error occurs randomly on startup. I think the odds are in the order of 1 in 30.

I have more information about this bug.

Describe the bug:

When a user play the game for the first time after install the game from Google Play, the game crashes. If the user open the game for the second time, the game works without problem.

To Reproduce:

  1. Uninstall the current version of the game from the test device.
  2. Install the game using the Google Play (the game is in alpha state, is still not public).
  3. Start the game clicking in the game icon.
  4. The game crashes, the android crash report window appears.

Expected behavior: The game should start smoothly.

Defold version:

05%20PM

Extensions:

04%20PM

Platforms: Android

Logs: Using adb logcat, the following message appears:

09-15 21:20:33.531 28913 28947 E defold.sound: App is missing the READ_PHONE_STATE permission. Audio will continue while phone call is active.
09-15 21:20:34.911 28913 28913 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate receiver com.defold.adtruth.InstallReceiver: java.lang.ClassNotFoundException: Didn’t find class “com.defold.adtruth.InstallReceiver” on path: DexPathList[[zip file “/data/app/com.heizhu.brokenskulls-1/base.apk”],nativeLibraryDirectories=[/data/app/com.heizhu.brokenskulls-1/lib/arm64, /data/app/com.heizhu.brokenskulls-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
09-15 21:20:34.911 28913 28913 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.defold.adtruth.InstallReceiver” on path: DexPathList[[zip file “/data/app/com.heizhu.brokenskulls-1/base.apk”],nativeLibraryDirectories=[/data/app/com.heizhu.brokenskulls-1/lib/arm64, /data/app/com.heizhu.brokenskulls-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
09-15 21:20:34.911 28913 28913 E AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: com.defold.adtruth.InstallReceiver

I can reproduce the bug now, so if you need more info just ask me.

Woah! The com.defold.adtruth namespace was used by King games to handle install attribution. It has been gone from the engine for a very long time. I’m a bit confused since you’re using a new editor. Is the apk that is crashing actually built using that version of the editor?

1 Like

Yes, the apk was generated using this version of the editor.

I am using Defold for a year or more, maybe some file of older version remains? Or maybe some older file remains in my device?

Are you using a custom manifest file? If that is the case then please make sure to update it to match the up to date manifest in builtins/manifest/android

2 Likes