Starting in 3D WebView v4.3, if Java minification is enabled in "Android Player Settings -> Publishing Settings -> Minify", then 3D WebView automatically creates or updates the project's proguard-user.txt file (located at Assets/Plugins/Android/proguard-user.txt) to include the Proguard rules needed to prevent the names of 3D WebView's Java classes from being obfuscated. Without the necessary Proguard rules, 3D WebView would fail at runtime with errors in the Logcat logs like these:
E/3D WebView: 3D WebView's native Android Java classes could not be found! This is likely due to minification being enabled in Android Player Settings -> Publishing Settings. Please see the following support article on minification: https://support.vuplex.com/articles/android-minification
...
E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuplex.webview.WebView3D
...
E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuplex.webview.WebView
...
E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.vuplex.webview.gecko.GeckoWebView
3D WebView's build scripts for Android (AndroidBuildScript.cs and AndroidGeckoBuildScript.cs) automatically copy the rules from the following files to the proguard-user.txt file:
- 3D WebView for Android: Assets/Vuplex/WebView/Android/Plugins/proguard-webview-android.txt
- 3D WebView for Android with Android Gecko: Assets/Vuplex/WebView/AndroidGecko/Plugins/proguard-webview-android-gecko.txt
If you're encountering the error messages listed above, that may indicate that 3D WebView's build scripts are failing to automatically add the needed proguard rules as expected. If that's the case, a workaround is to manually create a file at Assets/Plugins/Android/proguard-user.txt that contains the rules listed in proguard-webview-android.txt and/or proguard-webview-android-gecko.txt. If you've ensured that the your proguard-user.txt file contains the needed rules and you're still encountering the issue, then that indicates that your project is likely missing 3D WebView's Java library (VuplexWebViewAndroid.jar and/or VuplexWebViewAndroidGecko.jar). If that's the case, please re-import 3D WebView to resolve the issue.