microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.93k stars 1.46k forks source link

[iOS] App updates -> white screen -> crash #396

Closed vanBrunneren closed 8 years ago

vanBrunneren commented 8 years ago

hi

I created a react-native app with code-push. If I run my version local (with release schema) it downloads the bundle file from code-push and works perfectly. Then I uploaded my app to TestFlight and everything went fine. After that I submitted an update to code push.

The testflight app now opens, then it downloads the new file (shows white screen), and stays in this white screen, after a few seconds it's crashing and code push will rollback.

Does anyone have a solution for this? I'm happy about every advice.

I'm calling codePush.sync(); in the componentDidMount of my Main Component.

lostintangent commented 8 years ago

@vanBrunneren That's really odd that you're experiencing this. Apologies! We have a lot of users that distribute via TestFlight, and I'm not aware of anything that would be different between a local or TestFlight distribution. Just to confirm, are you literally calling just codePush.sync() in your main component, or are you passing in parameters to the sync call? I just want to be able to identify your exact repro case.

Additionally, can you share your AppDelegate.m contents that configure your JS bundle location? I just want to rule out any potential config issues (unlikely but possible). Could you also share how you are releasing your updates? Are you flagging them as mandatory? Assuming you're simply calling codePush.sync(), the only reason the app would programmatically restart (and potentially lead to the white screen) is if the update was marked as mandatory. If you're not releasing updates as mandatory, but you're seeing this behavior, then that might be cause for another issue.

Also, just to confirm. You mentioned that the app rolls back. After the crash happens, and you re-open the app, it had successfully returned back to the binary version? I just want to double-check that the rollback feature is working correctly here.

We'll try to figure this out and get you unblocked ASAP.

vanBrunneren commented 8 years ago

@lostintangent hey thank you for your fast answer ;)

In the binary which I have uploaded to TestFlight I had the following configuration in my componentDidMount of the main Component:

componentDidMount() {

        codePush.sync({ installMode: codePush.InstallMode.IMMEDIATE });

        AppState.addEventListener("change", (newState) => {
            newState === "active" && codePush.sync({ installMode: codePush.InstallMode.IMMEDIATE });
        });
}

I changed this method in my update in code push. But as I'm realizing this, the change in the updated file doesn't have any impact on this because code push hasn't updated my file right?

My AppDelegate looks like this in the CodeLocation Session:

#ifdef DEBUG
    jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
#else
    jsCodeLocation = [CodePush bundleURL];
#endif

Do you need more of the AppDelegate?

I'm releasing my updates with this commands: code-push release-react <AppName> ios -> then it goes to the Staging code-push promote <AppName> Staging Production -> and its live

Yes if it crashes and I open the app again it returns (rollback) to the binary version. The rollback works as it should I guess, because the new release has an error (or code-push think it has an error 😄 ) and it returns to the binary version.

thank you for your help

vanBrunneren commented 8 years ago

maybe this helps in this case, and maybe you can tell me that this isn't a issue with code-push.

I managed to get an error from fabric.io:

Fatal Exception: RCTFatalException: Unhandled JS Exception: Native module cannot be null.
0  CoreFoundation                 0x180f12db0 __exceptionPreprocess
1  libobjc.A.dylib                0x180577f80 objc_exception_throw
2  CoreFoundation                 0x180f12cf8 -[NSException initWithCoder:]
3  Akionis.ch                     0x100187190 RCTFatal (RCTAssert.m:137)
4  Akionis.ch                     0x1001820a0 -[RCTExceptionsManager reportFatalException:stack:exceptionId:] (RCTExceptionsManager.m:64)
5  CoreFoundation                 0x180f18a60 __invoking___
6  CoreFoundation                 0x180e10488 -[NSInvocation invoke]
7  CoreFoundation                 0x180e14db0 -[NSInvocation invokeWithTarget:]
8  Akionis.ch                     0x100185978 -[RCTModuleMethod invokeWithBridge:module:arguments:] (RCTModuleMethod.m:499)
9  Akionis.ch                     0x1001a6ec0 -[RCTBatchedBridge _handleRequestNumber:moduleID:methodID:params:] (RCTBatchedBridge.m:981)
10 Akionis.ch                     0x1001a68b4 __33-[RCTBatchedBridge handleBuffer:]_block_invoke.319 (RCTBatchedBridge.m:909)
11 libdispatch.dylib              0x18095d4bc _dispatch_call_block_and_release
12 libdispatch.dylib              0x18095d47c _dispatch_client_callout
13 libdispatch.dylib              0x1809694c0 _dispatch_queue_drain
14 libdispatch.dylib              0x180960f80 _dispatch_queue_invoke
15 libdispatch.dylib              0x18095d47c _dispatch_client_callout
16 libdispatch.dylib              0x18096b914 _dispatch_root_queue_drain
17 libdispatch.dylib              0x18096b0b0 _dispatch_worker_thread3
18 libsystem_pthread.dylib        0x180b75470 _pthread_wqthread
19 libsystem_pthread.dylib        0x180b75020 start_wqthread

but I still don't know why this is happening on TestFlight and when I run it locally it works...

lostintangent commented 8 years ago

@vanBrunneren That is very useful! Would you be able to view the "more details" view of that crash and paste in the JS stack? There should hopefully be more information about the exception. I can see where in RN that exception is occuring, but it would be extremely useful if we had a rough indication of why it happened.

vanBrunneren commented 8 years ago

I don't really know if this helps you an if this is what you want but thats the best I can get:

 # Crashlytics - plaintext stacktrace downloaded by Pascal Brunner at Mon, 27 Jun 2016 12:34:22 GMT
# URL: https://fabric.io/couponplus/ios/apps/ch.aktionis.aktionis/issues/576d0118ffcdc04250c06ecc/sessions/eb1ada9dc1924623b1c8c59c085be20d
# Organization: CouponPlus
# Platform: ios
# Application: Aktionis
# Version: 2.0.2 (14)
# Bundle Identifier: ch.aktionis.Aktionis
# Issue: 12
# Session: eb1ada9dc1924623b1c8c59c085be20d
# Date: 2016-06-26T17:54:15Z

Fatal Exception: RCTFatalException: Unhandled JS Exception: this._nativeModule.addListener is not a function. (In 'this._nativeModule.addListener(e)', 'this._nativeModule.addListener' is undefined)
0  CoreFoundation                 0x1820c2db0 __exceptionPreprocess
1  libobjc.A.dylib                0x181727f80 objc_exception_throw
2  CoreFoundation                 0x1820c2cf8 -[NSException initWithCoder:]
3  Akionis.ch                     0x1000e3190 RCTFatal (RCTAssert.m:137)
4  Akionis.ch                     0x1000de0a0 -[RCTExceptionsManager reportFatalException:stack:exceptionId:] (RCTExceptionsManager.m:64)
5  CoreFoundation                 0x1820c8a60 __invoking___
6  CoreFoundation                 0x181fc0488 -[NSInvocation invoke]
7  CoreFoundation                 0x181fc4db0 -[NSInvocation invokeWithTarget:]
8  Akionis.ch                     0x1000e1978 -[RCTModuleMethod invokeWithBridge:module:arguments:] (RCTModuleMethod.m:499)
9  Akionis.ch                     0x100102ec0 -[RCTBatchedBridge _handleRequestNumber:moduleID:methodID:params:] (RCTBatchedBridge.m:981)
10 Akionis.ch                     0x1001028b4 __33-[RCTBatchedBridge handleBuffer:]_block_invoke.319 (RCTBatchedBridge.m:909)
11 libdispatch.dylib              0x181b0d4bc _dispatch_call_block_and_release
12 libdispatch.dylib              0x181b0d47c _dispatch_client_callout
13 libdispatch.dylib              0x181b194c0 _dispatch_queue_drain
14 libdispatch.dylib              0x181b10f80 _dispatch_queue_invoke
15 libdispatch.dylib              0x181b0d47c _dispatch_client_callout
16 libdispatch.dylib              0x181b1b914 _dispatch_root_queue_drain
17 libdispatch.dylib              0x181b1b0b0 _dispatch_worker_thread3
18 libsystem_pthread.dylib        0x181d25470 _pthread_wqthread
19 libsystem_pthread.dylib        0x181d25020 start_wqthread

#-1. com.apple.xpc.uncorkq
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  libxpc.dylib                   0x181d6b14c xpc_pipe_routine + 256
3  libxpc.dylib                   0x181d5df18 _xpc_interface_routine + 200
4  libxpc.dylib                   0x181d65b7c _xpc_bootstrap_services + 120
5  libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
6  libdispatch.dylib              0x181b18728 _dispatch_barrier_sync_f_invoke + 100
7  libxpc.dylib                   0x181d5a24c _xpc_dyld_image_callback + 308
8  Akionis.ch                     0x1200f885c (Missing)
9  Akionis.ch                     0x1201016a4 (Missing)
10 Akionis.ch                     0x1200f8a0c (Missing)
11 Akionis.ch                     0x1200fdf78 (Missing)
12 libdispatch.dylib              0x181b3d6a0 (Missing)
13 UIFoundation                   0x1871a751c init_UIApplicationLinkedOnOrAfter + 48
14 UIFoundation                   0x1871a3fbc +[NSTextStorage initialize] + 80
15 libobjc.A.dylib                0x181728fc8 _class_initialize + 800
16 libobjc.A.dylib                0x18172f8b8 lookUpImpOrForward + 184
17 libobjc.A.dylib                0x181739d78 _objc_msgSend_uncached_impcache + 56
18 Akionis.ch                     0x10017eab0 -[RCTText initWithFrame:] (RCTText.m:26)
19 Akionis.ch                     0x1001799f8 -[RCTTextManager view] (RCTTextManager.m:36)
20 Akionis.ch                     0x100129f1c -[RCTComponentData createViewWithTag:] (RCTComponentData.m:92)
21 Akionis.ch                     0x100125938 __50-[RCTUIManager createView:viewName:rootTag:props:]_block_invoke (RCTUIManager.m:949)
22 libdispatch.dylib              0x181b0d4bc _dispatch_call_block_and_release + 24
23 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
24 libdispatch.dylib              0x181b12b84 _dispatch_main_queue_callback_4CF + 1844
25 CoreFoundation                 0x182078d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
26 CoreFoundation                 0x182076bb8 __CFRunLoopRun + 1628
27 CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
28 GraphicsServices               0x183888088 GSEventRunModal + 180
29 UIKit                          0x18728a088 UIApplicationMain + 204
30 Akionis.ch                     0x100022c04 main (main.m:16)
31 libdispatch.dylib              0x181b3e8b8 (Missing)

#0. com.apple.NSURLSession-work
0  libsystem_kernel.dylib         0x181c5bf48 __psynch_mutexdrop + 8
1  libsystem_pthread.dylib        0x181d2a07c _pthread_mutex_unlock_drop + 68
2  libobjc.A.dylib                0x181729318 monitor_tt<false>::leave() + 16
3  libobjc.A.dylib                0x1817290c8 _class_initialize + 1056
4  libobjc.A.dylib                0x18172f8b8 lookUpImpOrForward + 184
5  libobjc.A.dylib                0x181739d78 _objc_msgSend_uncached_impcache + 56
6  CFNetwork                      0x1827f64c8 -[NSHTTPCookieStorage cookiesForURL:] + 172
7  CFNetwork                      0x1827261e4 -[__NSURLBackgroundSession requestWithCookiesApplied:] + 232
8  CFNetwork                      0x1827274cc -[__NSURLBackgroundSession _onqueue_uploadTaskForRequest:uploadFile:bodyData:completion:] + 336
9  CFNetwork                      0x182727288 __80-[__NSURLBackgroundSession uploadTaskForRequest:uploadFile:bodyData:completion:]_block_invoke + 40
10 CFNetwork                      0x182726788 __68-[__NSURLBackgroundSession performBlockOnQueueAndRethrowExceptions:]_block_invoke + 76
11 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
12 libdispatch.dylib              0x181b18728 _dispatch_barrier_sync_f_invoke + 100
13 CFNetwork                      0x1827266e8 -[__NSURLBackgroundSession performBlockOnQueueAndRethrowExceptions:] + 144
14 CFNetwork                      0x1827271e8 -[__NSURLBackgroundSession uploadTaskForRequest:uploadFile:bodyData:completion:] + 204
15 Akionis.ch                     0x1001c82cc -[CLSNetworkClient startNewUploadRequest:filePath:] (CLSNetworkClient.m:206)
16 Akionis.ch                     0x1001c89f4 __77-[CLSNetworkClient checkSession:forTasksMatchingDescription:completionBlock:]_block_invoke (CLSNetworkClient.m:266)
17 CFNetwork                      0x1827d36c8 __46-[NSURLSession getTasksWithCompletionHandler:]_block_invoke_2 + 232
18 CFNetwork                      0x18272cc5c __67-[__NSURLBackgroundSession _onqueue_getTasksWithCompletionHandler:]_block_invoke + 28
19 Foundation                     0x182a7c540 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
20 Foundation                     0x1829ce870 -[NSBlockOperation main] + 96
21 Foundation                     0x1829bee48 -[__NSOperationInternal _start:] + 604
22 Foundation                     0x182a7e934 __NSOQSchedule_f + 224
23 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
24 libdispatch.dylib              0x181b194c0 _dispatch_queue_drain + 864
25 libdispatch.dylib              0x181b10f80 _dispatch_queue_invoke + 464
26 libdispatch.dylib              0x181b1b390 _dispatch_root_queue_drain + 728
27 libdispatch.dylib              0x181b1b0b0 _dispatch_worker_thread3 + 112
28 libsystem_pthread.dylib        0x181d25470 _pthread_wqthread + 1092
29 libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#1. com.apple.libdispatch-manager
0  libsystem_kernel.dylib         0x181c5d4d8 kevent_qos + 8
1  libdispatch.dylib              0x181b207d8 _dispatch_mgr_invoke + 232
2  libdispatch.dylib              0x181b0f648 _dispatch_source_invoke + 50

#2. Thread
0  libsystem_kernel.dylib         0x181c5cb48 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x181d25530 _pthread_wqthread + 1284
2  libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

Crashed: com.twitter.crashlytics.ios.exception
0  Akionis.ch                     0x1001c6a74 CLSProcessRecordAllThreads (CLSProcess.c:376)
1  Akionis.ch                     0x1001c6a74 CLSProcessRecordAllThreads (CLSProcess.c:376)
2  Akionis.ch                     0x1001c6e94 CLSProcessRecordAllThreads (CLSProcess.c:403)
3  Akionis.ch                     0x1001b7b84 CLSHandler (CLSHandler.m:24)
4  Akionis.ch                     0x1001c5198 __CLSExceptionRecord_block_invoke (CLSException.mm:197)
5  libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
6  libdispatch.dylib              0x181b18728 _dispatch_barrier_sync_f_invoke + 100
7  Akionis.ch                     0x1001c4c44 CLSExceptionRecord (CLSException.mm:206)
8  Akionis.ch                     0x1001c4a80 CLSExceptionRecordNSException (CLSException.mm:102)
9  Akionis.ch                     0x1001c46e0 CLSTerminateHandler() (CLSException.mm:259)
10 libc++abi.dylib                0x18171af44 std::__terminate(void (*)()) + 16
11 libc++abi.dylib                0x18171a85c __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 134
12 libobjc.A.dylib                0x181728094 _objc_exception_destructor(void*) + 330
13 Akionis.ch                     0x10010302c -[RCTBatchedBridge _handleRequestNumber:moduleID:methodID:params:] (RCTBatchedBridge.m:986)
14 Akionis.ch                     0x1001028b4 __33-[RCTBatchedBridge handleBuffer:]_block_invoke.319 (RCTBatchedBridge.m:909)
15 libdispatch.dylib              0x181b0d4bc _dispatch_call_block_and_release + 24
16 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
17 libdispatch.dylib              0x181b194c0 _dispatch_queue_drain + 864
18 libdispatch.dylib              0x181b10f80 _dispatch_queue_invoke + 464
19 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
20 libdispatch.dylib              0x181b1b914 _dispatch_root_queue_drain + 2140
21 libdispatch.dylib              0x181b1b0b0 _dispatch_worker_thread3 + 112
22 libsystem_pthread.dylib        0x181d25470 _pthread_wqthread + 1092
23 libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#4. Thread
0  libsystem_kernel.dylib         0x181c5c41c __semwait_signal + 8
1  libsystem_c.dylib              0x181b7922c nanosleep + 212
2  libc++.1.dylib                 0x1816f13b4 std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 84
3  JavaScriptCore                 0x185cc2690 bmalloc::Heap::scavenge(std::__1::unique_lock<bmalloc::StaticMutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 188
4  JavaScriptCore                 0x185cc2340 bmalloc::Heap::concurrentScavenge() + 84
5  JavaScriptCore                 0x185cc4ad8 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::entryPoint() + 100
6  JavaScriptCore                 0x185cc4a68 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::pthreadEntryPoint(void*) + 12
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#5. WebThread
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  CoreFoundation                 0x182078c60 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x182076964 __CFRunLoopRun + 1032
4  CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
5  WebCore                        0x185f8e61c RunWebThread(void*) + 456
6  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
7  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
8  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#6. JavaScriptCore::Marking
0  libsystem_kernel.dylib         0x181c5bf24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x181d26ce8 _pthread_cond_wait + 648
2  libc++.1.dylib                 0x1816b342c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
3  JavaScriptCore                 0x185a752cc JSC::GCThread::waitForNextPhase() + 144
4  JavaScriptCore                 0x185a75364 JSC::GCThread::gcThreadMain() + 84
5  JavaScriptCore                 0x18574af14 WTF::threadEntryPoint(void*) + 212
6  JavaScriptCore                 0x18574ae24 WTF::wtfThreadEntryPoint(void*) + 24
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#7. com.facebook.react.ShadowQueue
0  libsystem_kernel.dylib         0x181c5bf24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x181d26ce8 _pthread_cond_wait + 648
2  libobjc.A.dylib                0x1817292b8 monitor_tt<false>::wait() + 28
3  libobjc.A.dylib                0x181728ef8 _class_initialize + 592
4  libobjc.A.dylib                0x18172f8b8 lookUpImpOrForward + 184
5  libobjc.A.dylib                0x181739d78 _objc_msgSend_uncached_impcache + 56
6  Akionis.ch                     0x10018224c -[RCTShadowText buildTextStorageForWidth:widthMode:] (RCTShadowText.m:125)
7  Akionis.ch                     0x1001836c4 RCTMeasure (RCTShadowText.m:37)
8  Akionis.ch                     0x1000e77e8 layoutNode (Layout.c:616)
9  Akionis.ch                     0x1000e7f1c layoutNode (Layout.c:816)
10 Akionis.ch                     0x1000e84cc layoutNode (Layout.c:960)
11 Akionis.ch                     0x1000e84cc layoutNode (Layout.c:960)
12 Akionis.ch                     0x1000e84cc layoutNode (Layout.c:960)
13 Akionis.ch                     0x1000de7d0 -[RCTRootShadowView collectViewsWithUpdatedFrames] (RCTRootShadowView.m:40)
14 Akionis.ch                     0x100122004 -[RCTUIManager uiBlockWithLayoutUpdateForRootView:] (RCTUIManager.m:514)
15 Akionis.ch                     0x10012694c -[RCTUIManager _layoutAndMount] (RCTUIManager.m:1062)
16 Akionis.ch                     0x100102dc0 __36-[RCTBatchedBridge batchDidComplete]_block_invoke (RCTBatchedBridge.m:948)
17 libdispatch.dylib              0x181b0d4bc _dispatch_call_block_and_release + 24
18 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
19 libdispatch.dylib              0x181b194c0 _dispatch_queue_drain + 864
20 libdispatch.dylib              0x181b10f80 _dispatch_queue_invoke + 464
21 libdispatch.dylib              0x181b1b390 _dispatch_root_queue_drain + 728
22 libdispatch.dylib              0x181b1b0b0 _dispatch_worker_thread3 + 112
23 libsystem_pthread.dylib        0x181d25470 _pthread_wqthread + 1092
24 libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#8. com.twitter.crashlytics.ios.binary-images
0  libsystem_kernel.dylib         0x181c5bf6c __psynch_mutexwait + 8
1  libsystem_pthread.dylib        0x181d2a39c _pthread_mutex_lock_wait + 96
2  libsystem_pthread.dylib        0x181d2a57c _pthread_mutex_lock_slow + 296
3  libdispatch.dylib              0x181b3caec (Missing)
4  libdispatch.dylib              0x181b3d590 (Missing)
5  Akionis.ch                     0x1001e3690 CLSMachOSliceGetExecutablePath (CLSMachO.m:264)
6  Akionis.ch                     0x1001af500 __CLSBinaryImageChanged_block_invoke (CLSBinaryImage.m:503)
7  libdispatch.dylib              0x181b0d4bc _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
9  libdispatch.dylib              0x181b194c0 _dispatch_queue_drain + 864
10 libdispatch.dylib              0x181b10f80 _dispatch_queue_invoke + 464
11 libdispatch.dylib              0x181b0d47c _dispatch_client_callout + 16
12 libdispatch.dylib              0x181b1b914 _dispatch_root_queue_drain + 2140
13 libdispatch.dylib              0x181b1b0b0 _dispatch_worker_thread3 + 112
14 libsystem_pthread.dylib        0x181d25470 _pthread_wqthread + 1092
15 libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#9. com.twitter.crashlytics.ios.MachExceptionServer
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  Akionis.ch                     0x1001b2bdc CLSMachExceptionServer (CLSMachException.c:179)
3  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
4  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
5  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#10. Thread
0  libsystem_kernel.dylib         0x181c5cb48 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x181d25530 _pthread_wqthread + 1284
2  libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#11. com.facebook.react.JavaScript
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  CoreFoundation                 0x182078c60 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x182076964 __CFRunLoopRun + 1032
4  CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
5  Akionis.ch                     0x1000fabf8 +[RCTJSCExecutor runRunLoopThread] (RCTJSCExecutor.mm:233)
6  Foundation                     0x182a97e4c __NSThread__start__ + 1000
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#12. Thread
0  libsystem_kernel.dylib         0x181c5cb48 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x181d25530 _pthread_wqthread + 1284
2  libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#13. Thread
0  libsystem_kernel.dylib         0x181c5cb48 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x181d25530 _pthread_wqthread + 1284
2  libsystem_pthread.dylib        0x181d25020 start_wqthread + 4

#14. JavaScriptCore::Marking
0  libsystem_kernel.dylib         0x181c5bf24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x181d26ce8 _pthread_cond_wait + 648
2  libc++.1.dylib                 0x1816b342c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
3  JavaScriptCore                 0x185a752cc JSC::GCThread::waitForNextPhase() + 144
4  JavaScriptCore                 0x185a75364 JSC::GCThread::gcThreadMain() + 84
5  JavaScriptCore                 0x18574af14 WTF::threadEntryPoint(void*) + 212
6  JavaScriptCore                 0x18574ae24 WTF::wtfThreadEntryPoint(void*) + 24
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#15. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  CoreFoundation                 0x182078c60 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x182076964 __CFRunLoopRun + 1032
4  CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
5  CFNetwork                      0x182721c68 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6  Foundation                     0x182a97e4c __NSThread__start__ + 1000
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#16. AVAudioSession Notify Thread
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  CoreFoundation                 0x182078c60 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x182076964 __CFRunLoopRun + 1032
4  CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
5  libAVFAudio.dylib              0x1887199e0 GenericRunLoopThread::Entry(void*) + 164
6  libAVFAudio.dylib              0x1886ee75c CAPThread::Entry(CAPThread*) + 84
7  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
8  libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
9  libsystem_pthread.dylib        0x181d25028 thread_start + 4

#17. GAIThread
0  libsystem_kernel.dylib         0x181c40fd8 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x181c40e54 mach_msg + 72
2  CoreFoundation                 0x182078c60 __CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x182076964 __CFRunLoopRun + 1032
4  CoreFoundation                 0x181fa0c50 CFRunLoopRunSpecific + 384
5  Foundation                     0x1829b0cfc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
6  Foundation                     0x182a06030 -[NSRunLoop(NSRunLoop) run] + 88
7  Akionis.ch                     0x100042d98 +[GAI threadMain:] (GAI.m:229)
8  Foundation                     0x182a97e4c __NSThread__start__ + 1000
9  libsystem_pthread.dylib        0x181d27b28 _pthread_body + 156
10 libsystem_pthread.dylib        0x181d27a8c _pthread_body + 154
11 libsystem_pthread.dylib        0x181d25028 thread_start + 4
lostintangent commented 8 years ago

That's interesting. Your first exception seemed to be caused by this line, but the second seemed to be caused by this line. In order for the second one to occur, presumably there would need to have been some kind of race condition.

Could you let us know which version of React Native you're running, as well as which other 3rd party modules you have installed? I'm wondering if there is a bug/incompatibility with our plugin somewhere.

vanBrunneren commented 8 years ago

this is my package.json:

{
  ...
  },
  "scripts": {
    "start": "node_modules/react-native/packager/packager.sh"
  },
  "dependencies": {
    "@exponent/react-native-navigator": "^0.4.5",
    "alt": "^0.18.4",
    "react": "^15.1.0",
    "react-native": "^0.27.0",
    "react-native-activity-view": "^0.2.8",
    "react-native-android-statusbar": "^0.1.2",
    "react-native-carousel": "^0.8.0",
    "react-native-code-push": "^1.7.3-beta",
    "react-native-device-info": "^0.9.3",
    "react-native-facebook-login": "^1.2.0",
    "react-native-google-analytics-bridge": "^2.0.0",
    "react-native-htmlview": "^0.5.0",
    "react-native-maps": "^0.5.0",
    "react-native-radio-buttons": "^0.11.0",
    "react-native-send-intent": "^1.0.10",
    "react-native-vector-icons": "^2.0.2",
    "rnpm": "^1.7.0"
  },
  "devDependencies": {
    "rnpm-plugin-upgrade": "^0.26.0"
  }
}
geof90 commented 8 years ago

Just a stab in the dark.. it seems that in RN >0.27 there were runtime errors around the nativeeventemitter class https://github.com/facebook/react-native/issues/8025, if you recently upgraded to RN 0.27, could u try re-running npm install and re-linking your modules?

The only other plugin that I see uses the deviceeventemitter is the fb login button, I would try removing it and seeing if the error still repros. I will try to see if i can diagnose the problem better

lostintangent commented 8 years ago

@vanBrunneren Any updates? After investigating, we haven't been able to repro this unfortunately. As @geof90 mentioned, it seems like this bug has been associated with native modules that haven't been properly installed. That is why many people mention running rnpm link solves it.

In your case, since you said everything works locally, but then breaks in TestFlight, I'm wondering whether there is something different happening in your build between the two environments. Can you confirm that you're using the same release/build steps in both cases?

vanBrunneren commented 8 years ago

Well after hours of digging / reinstalling and linking modules we decided to cancel this release and temporary remove code-push from our project.

We tried everything from changing the RN Version to changing / updating every plugin and we weren't able to fix this problem. We decided then to build a Release without the great feature of Code-Push, because we had to release as soon as possible. Our plan for now is to make our build stabler and as soon as we have time for this we're going to try Code-Push again.

I think in this issue one of the native Plugins was installed and configured with a wrong version of another plugin or the RN version or something like this. But nevermind we found another solution.

I'm closing this for now until I hit the same error (but hopfully not 😄 ). Thank you for your awesome plugin and the great support

cheers 🍻

lostintangent commented 8 years ago

@vanBrunneren Totally understood that getting your release out is the highest priority. That sucks that we weren't able to work out-of-the-box for your app, but please do reach out in the future if you try CodePush again. With the somewhat volatile nature of the React Native ecosystem right now, we're doing our best to improve interop with other 3rd party plugins, but we occasionally discover entirely new issues that we hadn't predicted/encountered before. Thanks again for reaching out!

ivpusic commented 7 years ago

@vanBrunneren any updates on this problem? are you again using code-push? how did you solve mentioned issue?

vanBrunneren commented 7 years ago

@ivpusic no at the moment we don't have the capacity to give code-push another shot. I hope we're getting this in the near future

thomasttvo commented 7 years ago

Experiencing this right now. When I archived the project, which includes code-push, I needed to remove a bunch of RN projects from the Libraries folder to prevent duplication error since we already load them with the Podfile. However, this action seemed to prevent the app from requiring some native modules when it runs.

sergey-akhalkov commented 7 years ago

Hi @thomasttvo, could you please create new issue in react-native-code-push repo and provide us as much info as possible? Also it would be very helpful for us if you could try to reproduce the issue on our sample app - just to make sure if the issue have place because of CodePush.

thomasttvo commented 7 years ago

[Fixed] @sergey-akhalkov just found the fix yesterday. When I removed the Libraries projects, it caused some associated linked binaries to become inactive/conflicted as no reference to them was found, so:

In the end, I realized I misread the documentation. I thought the Podfile section and the linking Libraries section are 2 different steps, but it was actually 2 different alternatives.

sergey-akhalkov commented 7 years ago

@thomasttvo, got it, thanks for the clarification! Please let us know if you have any questions or see any issues.

KLEIODEVS commented 1 year ago

getting the same error any solution?