Max-Mobility / permobil-wear

3 stars 1 forks source link

Activity creation causes app startup crash #46

Closed finger563 closed 5 years ago

finger563 commented 5 years ago

After #37 (I think) I see this any time I start the app after a fresh nuke / build:

JS: attaching ambientController
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.permobil.smartdrive.wearos/com.permobil.smartdrive.MainActivity}: com.tns.NativeScriptException: 
System.err: Calling js method onCreate failed
System.err: 
System.err: Error: java.lang.IllegalStateException: Activity has been destroyed
System.err:     android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2114)
System.err:     android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:683)
System.err:     android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:637)
System.err:     android.support.wear.ambient.AmbientModeSupport.attach(AmbientModeSupport.java:261)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err:     com.permobil.smartdrive.MainActivity.onCreate(MainActivity.java:18)
System.err:     android.app.Activity.performCreate(Activity.java:6975)
System.err:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err:     android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err:     android.os.Handler.dispatchMessage(Handler.java:105)
System.err:     android.os.Looper.loop(Looper.java:164)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6541)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.permobil.smartdrive.wearos/files/app/vendor.js, line: 42860, column: 81
System.err: 
System.err: StackTrace: 
System.err:     Frame: function:'push../main-activity.js.MainActivity.onCreate', file:'file:///data/data/com.permobil.smartdrive.wearos/files/app/vendor.js', line: 42860, column: 82
System.err: 
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err:     at android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:105)
System.err:     at android.os.Looper.loop(Looper.java:164)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6541)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: Caused by: com.tns.NativeScriptException: 
System.err: Calling js method onCreate failed
System.err: 
System.err: Error: java.lang.IllegalStateException: Activity has been destroyed
System.err:     android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2114)
System.err:     android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:683)
System.err:     android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:637)
System.err:     android.support.wear.ambient.AmbientModeSupport.attach(AmbientModeSupport.java:261)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err:     com.permobil.smartdrive.MainActivity.onCreate(MainActivity.java:18)
System.err:     android.app.Activity.performCreate(Activity.java:6975)
System.err:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err:     android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err:     android.os.Handler.dispatchMessage(Handler.java:105)
System.err:     android.os.Looper.loop(Looper.java:164)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6541)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.permobil.smartdrive.wearos/files/app/vendor.js, line: 42860, column: 81
System.err: 
System.err: StackTrace: 
System.err:     Frame: function:'push../main-activity.js.MainActivity.onCreate', file:'file:///data/data/com.permobil.smartdrive.wearos/files/app/vendor.js', line: 42860, column: 82
System.err: 
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1070)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1050)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1042)
System.err:     at com.permobil.smartdrive.MainActivity.onCreate(MainActivity.java:18)
System.err:     at android.app.Activity.performCreate(Activity.java:6975)
System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err:     ... 9 more
System.err: Caused by: java.lang.IllegalStateException: Activity has been destroyed
System.err:     at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2114)
System.err:     at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:683)
System.err:     at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:637)
System.err:     at android.support.wear.ambient.AmbientModeSupport.attach(AmbientModeSupport.java:261)
System.err:     ... 19 more
JS: Error: The application crashed because of an uncaught exception. You can look at "stackTrace" or "nativeException" for more detailed information about the exception.
bradmartin commented 5 years ago

Didn't PR the final changes from Friday evening that got things working.