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
Missing dependencies cause crash when registering AppStateChanged callback #2645
Comments
I am glad you found a work around, that said the dependencies should have resolved on their own as they are included by the google mobile ads aar file. Can you help us out by including a log of your external dependency manager resolution process?
|
This worked for me too, just added the removed lines. Thank you... |
I meet this issue again. I tried @aaronflippo 's solution (added the removed lines in GoogleMobileAdDependencies.xml). it not only didn't work, but also made my app crash on startup |
Thanks @aaronflippo , that worked for me! |
Adding the following dependencies in the GoogleMobileAdsDependencies.xml worked for me.
|
Step 0: Are you in the right place?
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Calling this during startup (to register app stage change events for OnOpen ads):
Results in the following exception:
2023-04-12 11:44:43.679 13474-13538/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/DefaultLifecycleObserver;
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/DefaultLifecycleObserver;
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.ClassNotFoundException: androidx.lifecycle.DefaultLifecycleObserver
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[] args) [0x00000] in <00000
Steps to reproduce:
It looks like an important dependency may have been removed in commit 598e82e:
598e82e
Adding these lines back into the GoogleMobileAdDependencies.xml file fixes this for me:
https://maven.google.com/ https://maven.google.com/Relevant Code:
The text was updated successfully, but these errors were encountered: