mozilla-magnet / magnet-client

A nearby content discovery client for Android & iOS
Mozilla Public License 2.0
19 stars 11 forks source link

Crash: 'Unfortunately, project magnet has stopped' #200

Closed isabelrios closed 8 years ago

isabelrios commented 8 years ago

There is something that causes this crash. I can reproduce it 100% with the automated tests (please see video: https://youtu.be/sMK65BxEtLs) but not manually, although I got to see it.

With the automated tests it happens just when disabling bt and opening the app, but manually it is not reproducible following the same steps. It seems to happen when disabling bluetooth and leaving the app in background for a while but so far I see it randomly.

I was wondering if there was something wrong with the automated tests, but once I saw it at least once manually there is something that is causing this. I will investigate further to try to get some clear steps.

arcturus commented 8 years ago

@isabelrios can you give us the adb logcat output when the error happens?

isabelrios commented 8 years ago

I got to reproduce it, here the error I see in the log:

D/org.mozilla.magnet.MainActivity(30593): on pause D/org.mozilla.magnet.MainActivity(30593): set active: false I/ReactNativeJS(30593): '[App] app state changed', 'background' I/ReactNativeJS(30593): [App] start scanning E/AndroidRuntime(30593): FATAL EXCEPTION: mqt_native_modules E/AndroidRuntime(30593): Process: org.mozilla.magnet, PID: 30593 E/AndroidRuntime(30593): java.lang.RuntimeException: Could not invoke PromptBluetoothReact.prompt E/AndroidRuntime(30593): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:329) E/AndroidRuntime(30593): at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:187) E/AndroidRuntime(30593): at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:62) E/AndroidRuntime(30593): at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:432) E/AndroidRuntime(30593): at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method) E/AndroidRuntime(30593): at android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime(30593): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime(30593): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) E/AndroidRuntime(30593): at android.os.Looper.loop(Looper.java:211) E/AndroidRuntime(30593): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:187) E/AndroidRuntime(30593): at java.lang.Thread.run(Thread.java:818) E/AndroidRuntime(30593): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime(30593): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(30593): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(30593): at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:316) E/AndroidRuntime(30593): ... 10 more E/AndroidRuntime(30593): Caused by: java.lang.AssertionError E/AndroidRuntime(30593): at com.facebook.infer.annotation.Assertions.assertNotNull(Assertions.java:21) E/AndroidRuntime(30593): at com.facebook.react.bridge.ReactContext.startActivityForResult(ReactContext.java:264) E/AndroidRuntime(30593): at org.mozilla.magnet.PromptBluetoothReact.promptEnableBluetooth(PromptBluetoothReact.java:63) E/AndroidRuntime(30593): at org.mozilla.magnet.PromptBluetoothReact.prompt(PromptBluetoothReact.java:41) E/AndroidRuntime(30593): ... 13 more D/ActivityManager( 866): New dropbox entry: org.mozilla.magnet, data_app_crash, ddb3f4c0-be17-41ca-b9f6-310b43b9f51c W/ActivityManager( 866): Force finishing activity 1 org.mozilla.magnet/.MainActivity I/ActivityManager( 866): Killing 29698:com.google.android.gm/u0a126 (adj 15): empty #26 I/Timeline( 1293): Timeline: Activity_idle id: android.os.BinderProxy@28c09ba9 time:4586531 W/ContextImpl(26697): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1761 android.content.ContextWrapper.bindService:539 com.sonyericsson.crashmonitor.MiscTaAdapter.open:90 com.sonyericsson.crashmonitor.service.CrashMonitorService.onInit:127 com.sonyericsson.crashmonitor.service.CrashMonitorService.onHandleIntent:192 I/Adreno-EGL( 866): : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.01.00.042.030_msm8974_LA.BF.1.1.1_RB1__release_AU ()

If this is not helpful I can share the full logs file. Thanks @arcturus

wilsonpage commented 8 years ago

@isabelrios interested to know if this still reproduces.

isabelrios commented 8 years ago

@wilsonpage Yes, it still happens, it has to do with the fact that we try to open/refresh the app when bluetooth is disabled (while the app was in background or foreground, if it is closed initially, this does not happen) and somehow the app is not able to show the warning message to enable bluetooth, then the app is closed.

isabelrios commented 8 years ago

Lets keep issue #242 to track this issue and close this one