[unity] Android package error java.lang.ClassNotFoundException Did not find class com.unity3d . player.MainActivity

Unity version from 2019.2.8 to 2019.3.14, then pack android package, smoothly out of the package, but run flash back.
the logcat, error Java lang. RuntimeException: Unable to instantiate the activity ComponentInfo {the package name/com. Unity3d. Player. The MainActivity} : Java. Lang. ClassNotFoundException: Didn ‘t find the class “com. Unity3d. Player. MainActivity” on the path: DexPathList [[zip file “/ data/app/author/base package name – 1. The apk”], nativeLibraryDirectories = [/ data/app/lib// the author package name – 1 arm,/vendor/lib,/system/lib]]
the at android. The app. ActivityThread. PerformLaunchActivity ActivityThread. Java: (2238)
to find the reasons for half a day, many of them said android studio setting of instant run option to cancel. But my apk is straight out of unity


prefix the package name with the name of the startup item in the androidmanifest.xml.

I wrote a plug-in with the same package name as the Unity project, where MainActivity is defined (inherited from Unity playeractivity).

is able to get out of the package and run smoothly in 2019.2.8, using the Analyze APK of Android Studio, it was found that it has automatically added the content before MainActivity according to the package name set in Unity3D.




Read More: