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) strong>
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
Reason
h2>
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:
- Caused by: java.lang.ClassNotFoundException: com.alibaba.nacos.api.naming.NamingMaintainService
- Notes on unity project_ Unity webplayer failed to update unity web player
- Android error java.lang.IllegalStateException : System services not available to Activities before onC
- java.lang.ClassNotFoundException : com.mysql.jdbc . driver project cannot connect to database, exception, lack of MySQL driver
- 【Unity 3D】Because you are not a member of this project this build will not access Unity services.
- java.lang.IllegalStateException: Could not execute method for android:onClick
- How to Solve Unity Package Android Project Error
- Unity-failed to update unity web player
- java.lang.AbstractMethodError: Receiver class com.alibaba.cloud.sentinel.feign.SentinelContractHolde
- Android 9.0 APP Install Android 4.4 Error: classnotfoundexception
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- The solution of “failed to load il2cpp” in Android package launched by unity
- Solution in idea java.lang.ClassNotFoundException : org.springframework.web . context.ContextLoaderListener
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Used by: Java. Lang. classnotfoundexception: org. PostgreSQL. Driver
- Mybatis exception error setting driver on unpoleddatasource. Cause: java.lang.ClassNotFoundException :
- After unity connects with androidstudio, unity packages APK with an error: commandinvocationfailure: failed to re package resources
- Android appears java.lang.NoClassDefFoundError A solution to the error
- Idea error: (4, 28) Java: package com.alibaba.fastjson does not exist
- The Java command could not find or load the main class