I'm using google play plugins (https://developers.google.com/unity/packages?hl=en#google_play) app-review & app-update on Unity. and it worked just fine. until... I did something… (I’m not sure q_q... I'm sorry! … I removed few plugin here and there.) now I’m getting this error in runtime all of a sudden! on certain function call in review & app-update in the runtime build. Weird thing is, review works fine even with the error but app-update is not working with error. and app-building, force-resolving in editor are also all just fine. (all success!).
Detailed Logs. (Runtime Error, logged by Android Logcat In Editor)
2023/06/27 15:33:37.995 17867 17912 Error Unity AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/activity/result/ActivityResultLauncher; 2023/06/27 15:33:37.995 17867 17912 Error Unity java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/activity/result/ActivityResultLauncher; 2023/06/27 15:33:37.995 17867 17912 Error Unity at java.lang.reflect.Executable.getParameterTypesInternal(Native Method) 2023/06/27 15:33:37.995 17867 17912 Error Unity at java.lang.reflect.Method.getParameterTypes(Method.java:186) 2023/06/27 15:33:37.995 17867 17912 Error Unity at java.lang.Class.getDeclaredMethods(Class.java:1881) 2023/06/27 15:33:37.995 17867 17912 Error Unity at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:26) 2023/06/27 15:33:37.995 17867 17912 Error Unity at com.unity3d.player.UnityPlayerForActivityOrService.nativeRender(Native Method) 2023/06/27 15:33:37.995 17867 17912 Error Unity at com.unity3d.player.L.handleMessage(Unknown Source:140) 2023/06/27 15:33:37.995 17867 17912 Error Unity at android.os.Handler.dispatchMessage(Handler.java:102) 2023/06/27 15:33:37.995 17867 17912 Error Unity at android.os.Looper.loop(Looper.java:205) 2023/06/27 15:33:37.995 17867 17912 Error Unity at com.unity3d.player.O.run(Unknown Source:24) 2023/06/27 15:33:37.995 17867 17912 Error Unity Caused by: java.lang.ClassNotFoundException: Didn’t find class “androidx.activity.result.ActivityResultLauncher” on path: DexPathList[[zip file “/system/framework/org.apache.http.legacy.boot.jar”, zip file "/data/app/
What I tried. (But Not Worked)
- Uninstalling & Reinstalling SDK JDK.
- Uninstalling & Reinstalling All GooglePlay Plugins to the latest version. (+Rebuilding Library)
- Uninstalling & Reinstalling Unity Editor.
- Upgrading Unity Editor to Latest version available (2023.01.01f1)
- Removing JAVA, Android Studio and other tools except Unity-installed ones & using only default Unity-installed SDK JDK NDK, Gradle tool.
- Removing C:\Users\xxx.gradle and Recreating via rebuilding.
Working fine : Force-resolve(Unity Editor), firebase(Runtime Remote-config, DataBase, Analytics), google play auto-sign in (Runtime), app-review (Request & posting all successful, * even with error) (runtime).
Not Working : app-update. (can not use the function : appUpdateManager.GetAppUpdateInfo()) (runtime)