Search Unity

java.lang.RuntimeException: Unable to start activity

Discussion in 'Android' started by Felix-Liu, Jul 26, 2013.

  1. Felix-Liu

    Felix-Liu

    Joined:
    Sep 3, 2012
    Posts:
    5
    java.lang.RuntimeException: Unable to start activity ComponentInfo{*.*.*/com.unity3d.player.UnityPlayerNativeActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2247)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
    at android.app.ActivityThread.access$700(ActivityThread.java:152)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5328)
    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:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NullPointerException
    at com.unity3d.player.g.a(Unknown Source)
    at com.unity3d.player.g.b(Unknown Source)
    at com.unity3d.player.UnityPlayer.resume(Unknown Source)
    at com.unity3d.player.UnityPlayer.a(Unknown Source)
    at com.unity3d.player.UnityPlayer.init(Unknown Source)
    at com.unity3d.player.UnityPlayerNativeActivity.onCreate(Unknown Source)
    at android.app.Activity.performCreate(Activity.java:5250)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
    ... 11 more
    java.lang.NullPointerException
    at com.unity3d.player.g.a(Unknown Source)
    at com.unity3d.player.g.b(Unknown Source)
    at com.unity3d.player.UnityPlayer.resume(Unknown Source)
    at com.unity3d.player.UnityPlayer.a(Unknown Source)
    at com.unity3d.player.UnityPlayer.init(Unknown Source)
    at com.unity3d.player.UnityPlayerNativeActivity.onCreate(Unknown Source)
    at android.app.Activity.performCreate(Activity.java:5250)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
    at android.app.ActivityThread.access$700(ActivityThread.java:152)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5328)
    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:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
     
    Last edited: Jul 26, 2013
  2. Felix-Liu

    Felix-Liu

    Joined:
    Sep 3, 2012
    Posts:
    5
    On some android devices, app can not launch. And I can find out What's the problem on the bug report, does anyone know it?
     
  3. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    Are you using some plugins in your project? Have you edited your AndroidManifest.xml? Are you launching your game from other Android app?

    Also did you remove your package name from the log?
    Unable to start activity ComponentInfo{*.*.*/com.unity3d.player.UnityPlayerNativeActivity}
     
  4. Felix-Liu

    Felix-Liu

    Joined:
    Sep 3, 2012
    Posts:
    5
    I think this is not the manifest problem. because my game can run well on most of the devices.
     
  5. nikolic

    nikolic

    Joined:
    Oct 15, 2011
    Posts:
    162
    I also have the similar issue with few devices:

    Samsung Galaxy S, Samsung Galaxy Mini, Samsung Galaxy Y, Alcatel OT-990.

    The game runs fine on at least 40 other devices, some of which are ARMv6 based.

    The game runs fine on the crashing devices when manually transferred from Unity using usb cable.

    Code (csharp):
    1. java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycompany.mygame/com.prime31.UnityPlayerActivity}: java.lang.ClassNotFoundException: com.prime31.UnityPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.mycompany.mygame-1.apk]
    2. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
    3. at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    4. at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    5. at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    6. at android.os.Handler.dispatchMessage(Handler.java:99)
    7. at android.os.Looper.loop(Looper.java:123)
    8. at android.app.ActivityThread.main(ActivityThread.java:4627)
    9. at java.lang.reflect.Method.invokeNative(Native Method)
    10. at java.lang.reflect.Method.invoke(Method.java:521)
    11. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
    12. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
    13. at dalvik.system.NativeStart.main(Native Method)
    14. Caused by: java.lang.ClassNotFoundException: com.prime31.UnityPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.mycompany.mygame-1.apk]
    15. at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
    16. at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
    17. at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
    18. at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
    19. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
    Can anybody help?
     
  6. BooooG

    BooooG

    Joined:
    Sep 4, 2013
    Posts:
    1
    I also have this issue ,add android:launchMode="singleinstance" to your customActivity in AndroidManifest.xml file. That work for me.
    I hope it can help you
     
    Last edited: Sep 5, 2013