Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AndroidJavaException: java.lang.ClassNotFoundException: com.onesignal.OneSignal #1785

Closed
1 task done
Ilya171 opened this issue Jul 14, 2023 · 2 comments
Closed
1 task done

Comments

@Ilya171
Copy link

Ilya171 commented Jul 14, 2023

What happened?

error in logs

Steps to reproduce?

import unitypackage

write code:  OneSignal.Initialize(appId);

build apk

What did you expect to happen?

that everything will work: OneSignal is initialized

OneSignal Android SDK version

v5 -beta3

Android version

13, 12, 11, 10, 9, 8, 7.1, 7.0, 6, 5.1, 5.0, 4.4

Specific Android models

No response

Relevant log output

AndroidJavaException: java.lang.ClassNotFoundException: com.onesignal.OneSignal
07-14 12:33:31.880  1253  1270 E Unity   : java.lang.ClassNotFoundException: com.onesignal.OneSignal
07-14 12:33:31.880  1253  1270 E Unity   :      at java.lang.Class.classForName(Native Method)
07-14 12:33:31.880  1253  1270 E Unity   :      at java.lang.Class.forName(Class.java:453)
07-14 12:33:31.880  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
07-14 12:33:31.880  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
07-14 12:33:31.880  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
07-14 12:33:31.880  1253  1270 E Unity   :      at android.os.Handler.dispatchMessage(Handler.java:102)
07-14 12:33:31.880  1253  1270 E Unity   :      at android.os.Looper.loop(Looper.java:216)
07-14 12:33:31.880  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
07-14 12:33:31.880  1253  1270 E Unity   : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.onesignal.OneSignal" on path: DexPathList[[zip file "/data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/base.apk"],nativeLibraryDirectories=[/data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/lib/arm, /data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
07-14 12:33:31.880  1253  1270 E Unity   :      at dalvik.system.BaseDexClassLoader.
07-14 12:33:31.957  1253  1270 E Unity   : AndroidJavaException: java.lang.ClassNotFoundException: com.onesignal.OneSignal
07-14 12:33:31.957  1253  1270 E Unity   : java.lang.ClassNotFoundException: com.onesignal.OneSignal
07-14 12:33:31.957  1253  1270 E Unity   :      at java.lang.Class.classForName(Native Method)
07-14 12:33:31.957  1253  1270 E Unity   :      at java.lang.Class.forName(Class.java:453)
07-14 12:33:31.957  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
07-14 12:33:31.957  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
07-14 12:33:31.957  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
07-14 12:33:31.957  1253  1270 E Unity   :      at android.os.Handler.dispatchMessage(Handler.java:102)
07-14 12:33:31.957  1253  1270 E Unity   :      at android.os.Looper.loop(Looper.java:216)
07-14 12:33:31.957  1253  1270 E Unity   :      at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
07-14 12:33:31.957  1253  1270 E Unity   : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.onesignal.OneSignal" on path: DexPathList[[zip file "/data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/base.apk"],nativeLibraryDirectories=[/data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/lib/arm, /data/app/com.BajiLive.cricket-01qzhmpHQJHMEBkLGKVRbw==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

Hello @Ilya171 thanks for reaching out! It sounds like you are using our Unity SDK, is that correct? Are you using Proguard?

If so, this could be similar to this Unity issue.

Could you please try the workaround proposed there and let us know your results?

Thanks!

@jennantilla
Copy link
Contributor

Closing due to no response. Please let us know if you are still having any issues.

We have a new major release available that includes many improvements and enhancements. Note that there are breaking changes with the update so please refer to the migration guide here.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants