google / play-unity-plugins

The Google Play Plugins for Unity provide C# APIs for accessing various Play services
Other
441 stars 115 forks source link

NoClassDefFoundError for ActivityResultLauncher #244

Open emrys90 opened 5 months ago

emrys90 commented 5 months ago

Full stack trace:

06-02 09:24:57.736 10774 10796 E Unity   : UnityEngine.AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/activity/result/ActivityResultLauncher;
06-02 09:24:57.736 10774 10796 E Unity   :   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
06-02 09:24:57.736 10774 10796 E Unity   :   at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <00000000000000000000000000000000>:0
06-02 09:24:57.736 10774 10796 E Unity   :   at UnityEngine.AndroidReflection.GetMethodMember (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) [0x00000] in <00000000000000000000000000000000>:0
06-02 09:24:57.736 10774 10796 E Unity   :   at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) [0x00000] in <00000000000000000000000000000000>:0
06-02 09:24:57.736 10774 10796 E Unity   :   at UnityEngine.AndroidJavaObject._Call (System.String methodName, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
06-02 09:24:57.736 10774 10796 E Unity   :   at Google.Play.AssetDelivery.Internal.AssetDeliveryUpdateHandler
06-02 09:24:57.799 10774 10796 I chatty  : uid=10221(com.DivergentRealities.CardsTankards) UnityMain identical 5 lines

Any ideas how I can fix this? It happens at startup when I'm trying to load from Addressables using PAD.

aleter commented 5 months ago

same crash

secondimpactrob commented 4 months ago

Try the suggestion in the comment linked below. Adding an androidx.activity dependency to a Dependencies.xml: https://github.com/google/play-unity-plugins/issues/236#issuecomment-1903394070

And also ensure targeting a recent enough Android (13 I believe).