gree / unity-webview

zlib License
2.27k stars 687 forks source link

[Solved] ClassNotFoundException when adding CUnityPlayerActivity to plugin #1089

Closed jonobarel-slatescience closed 1 month ago

jonobarel-slatescience commented 1 month ago

Hi! Following up on #1034, I'm trying to compile the plugin with our custom CUnityPlayerActivity class, and referencing it in AndroidManifest.xml.

In your recent fix you removed the need for CUnityPlayer for non-5.6 versions, so I've made sure to override the deletion - I know the class goes into the aar file.

However, I'm constantly getting the error that the class is not found when loading the app to a device.

Is it possible that I'm not referencing the correct plugin when compiling for Android?

jonobarel-slatescience commented 1 month ago

The problem was that the build was using your distributed version of the Android plugin and not the custom compiled one. Once I was able to overwrite them in the build, the problem was solved.

Solution process:

  1. Import the project via package manger.
  2. In a separate instance, compile the Android plugin via install.sh including custom classes
  3. Overwrite the plugin files in Package cache with custom .tmpl files.