Unity3D Caused by: java.lang.ClassNotFoundException: .MainActivity
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x40a561f8)
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.wwforever.eclipsebuildunity3d/com.wwforever.eclipsebuildunity3d.MainActivity}: java.lang.ClassNotFoundException: com.wwforever.eclipsebuildunity3d.MainActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.wwforever.eclipsebuildunity3d.MainActivity
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
Java Build Path를 통해 가져온 classes.jar 파일을 Order and Export 탭에서 체크를 해주면 해결됩니다.
threadid=1: thread exiting with uncaught exception (group=0x40a561f8)
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.wwforever.eclipsebuildunity3d/com.wwforever.eclipsebuildunity3d.MainActivity}: java.lang.ClassNotFoundException: com.wwforever.eclipsebuildunity3d.MainActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.wwforever.eclipsebuildunity3d.MainActivity
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
유니티3D 안드로이드 프로젝트를 이클립스로 빌드하는 과정에서 위와같이 에러가 발생했습니다. cocos2d-x 한참 할때 많이 봤던 오류네요. 유니티3D를 갑으로 빌드할 때는 이런 에러가 없었는데 이클립스를 갑으로 빌드해주니 이클립스 또는 안드로이드 특유의 이슈가 또 발생하는군요.
Java Build Path를 통해 가져온 classes.jar 파일을 Order and Export 탭에서 체크를 해주면 해결됩니다.
댓글
댓글 쓰기