OneSignal / OneSignal-Unity-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Other
222 stars 61 forks source link

[Bug]: ClassNotFoundException: java.util.function.Consumer #758

Open sntahmaz opened 2 months ago

sntahmaz commented 2 months ago

What happened?

OneSignal causes class not found exception on Android 6 and earlier versions. crash_session_stacktrace.txt

Steps to reproduce?

I couldn't reproduce but I have Crashlytics logs.

What did you expect to happen?

I expect OneSignal to work without exception on Android devices with API levels between 19 and 23.

Unity version

2021.3.43

OneSignal Unity SDK version

5.1.6

Platform

Android

Relevant log output

Fatal Exception: java.lang.Exception: AndroidJavaException : java.lang.ClassNotFoundException: java.util.function.Consumer
       at java.lang.Class.classForName(java.lang.Class)
       at java.lang.Class.forName(java.lang.Class)
       at com.unity3d.player.UnityPlayer.nativeRender(com.unity3d.player.UnityPlayer)
       at com.unity3d.player.UnityPlayer.access$300(com.unity3d.player.UnityPlayer)
       at com.unity3d.player.UnityPlayer$e$1.handleMessage(com.unity3d.player.UnityPlayer$e$1)
       at android.os.Handler.dispatchMessage(android.os.Handler)
       at android.os.Looper.loop(android.os.Looper)
       at com.unity3d.player.UnityPlayer$e.run(com.unity3d.player.UnityPlayer$e)
       at dalvik.system.BaseDexClassLoader.findClass(dalvik.system.BaseDexClassLoader)
       at java.lang.ClassLoader.loadClass(java.lang.ClassLoader)
       at java.lang.ClassLoader.loadClass(java.lang.ClassLoader)
       at java.lang.Class.classForName(java.lang.Class)
       at java.lang.BootClassLoader.findClass(java.lang.BootClassLoader)
       at java.lang.BootClassLoader.loadClass(java.lang.BootClassLoader)
       at java.lang.ClassLoader.loadClass(java.lang.ClassLoader)
       at UnityEngine.AndroidJNISafe.CheckException(UnityEngine.AndroidJNISafe)
       at UnityEngine.AndroidJNISafe.FindClass(UnityEngine.AndroidJNISafe)
       at UnityEngine.AndroidJavaClass._AndroidJavaClass(UnityEngine.AndroidJavaClass)
       at UnityEngine.AndroidJavaProxy..ctor(UnityEngine.AndroidJavaProxy.)
       at OneSignalSDK.Android.Utilities.BoolContinuation..ctor(OneSignalSDK.Android.Utilities.BoolContinuation.)
       at OneSignalSDK.Android.Notifications.AndroidNotificationsManager+<RequestPermissionAsync>d__17.MoveNext(OneSignalSDK.Android.Notifications.AndroidNotificationsManager+<RequestPermissionAsync>d__17)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine](System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult])
       at OneSignalSDK.Android.Notifications.AndroidNotificationsManager.RequestPermissionAsync(OneSignalSDK.Android.Notifications.AndroidNotificationsManager)
       at PushNotificationManager+<PromtForNotificationIfRequired>d__11.MoveNext(PushNotificationManager+<PromtForNotificationIfRequired>d__11)
       at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](System.Runtime.CompilerServices.AsyncVoidMethodBuilder)
       at PushNotificationManager.PromtForNotificationIfRequired(PushNotificationManager)
       at SceneControllers.MainSceneController.Start(SceneControllers.MainSceneController)

Code of Conduct