New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.16 version helloworld project crash when add SplashActivity #18884

Closed
pjdd opened this Issue Jun 8, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@pjdd

pjdd commented Jun 8, 2018

  • cocos2d-x version: 3.16
  • devices test on: android device
  • developing environments
    • NDK version: r10e
    • Xcode version: 9.1
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. I create two helloword projects by cocos commond,the first project I didn’t set “PROJECT_NAME”, when i use SplashActivity to be LAUNCHER activity and then AppActivity the project is ok and not crash,But in the second project I set “PROJECT_NAME” with my project name and then the second project is crash. the message is below

  2. E/AndroidRuntime: FATAL EXCEPTION: main
    Process: cn.gamejelly.gong2ming, PID: 16658
    java.lang.RuntimeException: Unable to destroy activity {cn.gamejelly.gong2ming/org.cocos2dx.lua.AppActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3823)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3841)
    at android.app.ActivityThread.access$1400(ActivityThread.java:174)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1451)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:222)
    at android.app.ActivityThread.main(ActivityThread.java:5484)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NullPointerException
    at org.cocos2dx.lib.Cocos2dxHelper.runOnGLThread(Cocos2dxHelper.java:109)
    at org.cocos2dx.lib.Cocos2dxAudioFocusManager.unregisterAudioFocusListener(Cocos2dxAudioFocusManager.java:121)
    at org.cocos2dx.lib.Cocos2dxActivity.onDestroy(Cocos2dxActivity.java:212)
    at org.cocos2dx.lua.AppActivity.onDestroy(AppActivity.java:58)
    at android.app.Activity.performDestroy(Activity.java:5635)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1119)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3810)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3841) 
    at android.app.ActivityThread.access$1400(ActivityThread.java:174) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1451) 
    at android.os.Handler.dispatchMessage(Handler.java:110) 
    at android.os.Looper.loop(Looper.java:222) 
    at android.app.ActivityThread.main(ActivityThread.java:5484) 
    at java.lang.reflect.Method.invokeNative(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:515) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676) 
    at dalvik.system.NativeStart.main(Native Method) 

@pjdd

This comment has been minimized.

Show comment
Hide comment
@pjdd

pjdd Jun 8, 2018

image

Because of Cocos2dxActivity class function
Comment it and it's ok

pjdd commented Jun 8, 2018

image

Because of Cocos2dxActivity class function
Comment it and it's ok

@pjdd pjdd closed this Jun 8, 2018

@drelaptop

This comment has been minimized.

Show comment
Hide comment
@drelaptop

drelaptop Sep 15, 2018

Collaborator

I think PR #19010 is a better solution. @pjdd

Collaborator

drelaptop commented Sep 15, 2018

I think PR #19010 is a better solution. @pjdd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment