1

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)

  1. Uninstalling & Reinstalling SDK JDK.
  2. Uninstalling & Reinstalling All GooglePlay Plugins to the latest version. (+Rebuilding Library)
  3. Uninstalling & Reinstalling Unity Editor.
  4. Upgrading Unity Editor to Latest version available (2023.01.01f1)
  5. Removing JAVA, Android Studio and other tools except Unity-installed ones & using only default Unity-installed SDK JDK NDK, Gradle tool.
  6. 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)

1 Answer 1

2

Ok! found the solution myself, you have to install Activity~.aar file yourself. (The error is about missing class in runtime.) Link : https://maven.google.com/web/index.html#androidx.activity:activity:1.6.0

This google maven repository is awesome! (ADD IT TO FAVORITE!) and Find the version that you can use and download, put the aar file into your project [ Assets\Plugins\Android ].

Force-Resolve it and build. Now the NoClassDefFoundError is gone!

Good Job Myself! AND THANKS A LOT STACKOVARFLAW!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.