react-native-unity-view icon indicating copy to clipboard operation
react-native-unity-view copied to clipboard

iOS crashes on launch in release builds only

Open mtostenson opened this issue 6 years ago • 57 comments

Unity version: 2018.2.1f1 React native version: 0.57.8

When running straight out of XCode, it works fine. However, creating a release IPA file results in an immediate crash on launch. We use fastlane to generate an IPA for beta testing, so we don't usually see this problem until then. I tested this using a blank react native project, and a blank unity project, and the crash is there. There are no useful crash logs unfortunately. Has anyone been able to publish an iOS release using this library?

Thanks

UPDATE: Setting "Strip Linked Product" to NO prevents this crash. However, this means the debug symbols are not removed and causes the app size to increase by 30-50%

FURTHER UPDATE The "Strip Linked Product" workaround does not appear to work for iOS 12.1.

Here is an issue I created in the react native repo that describes a possible solution.

Here's the crash report:

Thread 7 name:  com.facebook.react.JavaScript
Thread 7 Crashed:
0   libsystem_kernel.dylib        	0x00000001fbbbd104 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x00000001fbc3ca00 pthread_kill$VARIANT$armv81 + 296
2   libsystem_c.dylib             	0x00000001fbb14d78 abort + 140
3   libsystem_malloc.dylib        	0x00000001fbc11768 _malloc_put + 0
4   libsystem_malloc.dylib        	0x00000001fbc11924 malloc_report + 64
5   libsystem_malloc.dylib        	0x00000001fbc042d0 free + 376
6   libc++.1.dylib                	0x00000001fb1bf120 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string+ 258336 () + 32
7   UnityTest                     	0x0000000102de23a4 std::__1::__vector_base<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::~__vector_base() + 730020 (vector:451)
8   UnityTest                     	0x0000000103385214 facebook::react::ModuleRegistry::getConfig+ 6640148 (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 100
9   UnityTest                     	0x0000000103394168 facebook::react::JSCNativeModules::createModule+ 6701416 (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, OpaqueJSContext const*) + 292
10  UnityTest                     	0x0000000103393cc8 facebook::react::JSCNativeModules::getModule+ 6700232 (OpaqueJSContext const*, OpaqueJSString*) + 188
11  UnityTest                     	0x000000010338e85c OpaqueJSValue const* (*facebook::react::(anonymous namespace)::exceptionWrapMethod<&(facebook::react::JSCExecutor::getNativeModule(OpaqueJSValue*, OpaqueJSString*))>())(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)::funcWrapper::call+ 6678620 (OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) + 104
12  JavaScriptCore                	0x0000000203350404 JSC::JSCallbackObject<JSC::JSDestructibleObject>::getOwnPropertySlot+ 574468 (JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&) + 340
13  JavaScriptCore                	0x0000000203a354f0 llint_slow_path_get_by_id + 2008
14  JavaScriptCore                	0x0000000203328928 llint_entry + 11528
15  JavaScriptCore                	0x000000020332d134 llint_entry + 29972
16  JavaScriptCore                	0x000000020332d134 llint_entry + 29972
17  JavaScriptCore                	0x000000020332d134 llint_entry + 29972
18  JavaScriptCore                	0x000000020332d134 llint_entry + 29972
19  JavaScriptCore                	0x000000020332d134 llint_entry + 29972
20  JavaScriptCore                	0x0000000203325a1c vmEntryToJavaScript + 300
21  JavaScriptCore                	0x000000020399bfe4 JSC::Interpreter::executeProgram+ 7176164 (JSC::SourceCode const&, JSC::ExecState*, JSC::JSObject*) + 9620
22  JavaScriptCore                	0x0000000203b77218 JSC::evaluate+ 9122328 (JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 316
23  JavaScriptCore                	0x000000020334e634 JSEvaluateScript + 472
24  UnityTest                     	0x000000010336dad0 facebook::react::evaluateScript+ 6544080 (OpaqueJSContext const*, OpaqueJSString*, OpaqueJSString*) + 80
25  UnityTest                     	0x000000010338c918 facebook::react::JSCExecutor::loadApplicationScript+ 6670616 (std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 528
26  UnityTest                     	0x0000000103392ba4 std::__1::__function::__func<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0>, void (facebook::react::JSExecutor*)>::operator()+ 6695844 (facebook::react::JSExecutor*&&) + 144
27  UnityTest                     	0x0000000103393ba8 std::__1::function<void (facebook::react::JSExecutor*)>::operator()+ 6699944 (facebook::react::JSExecutor*) const + 40
28  UnityTest                     	0x000000010330c9cc facebook::react::tryAndReturnError(std::__1::function<void + 6146508 ()> const&) + 24
29  UnityTest                     	0x0000000103302528 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void + 6104360 ()> const&) + 24
30  CoreFoundation                	0x00000001fbfb6408 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
31  CoreFoundation                	0x00000001fbfb5d08 __CFRunLoopDoBlocks + 272
32  CoreFoundation                	0x00000001fbfb1220 __CFRunLoopRun + 2376
33  CoreFoundation                	0x00000001fbfb05b8 CFRunLoopRunSpecific + 436
34  UnityTest                     	0x00000001032e36a4 +[RCTCxxBridge runRunLoop] + 264
35  Foundation                    	0x00000001fcad73b0 __NSThread__start__ + 1040
36  libsystem_pthread.dylib       	0x00000001fbc412fc _pthread_body + 128
37  libsystem_pthread.dylib       	0x00000001fbc4125c _pthread_start + 48
38  libsystem_pthread.dylib       	0x00000001fbc44d08 thread_start + 4

mtostenson avatar Jan 05 '19 00:01 mtostenson

We've surfed all the web and tried so many solutions. This finally worked for us! Try to remove Up Arrows from all dependencies, i.e package.json. As an example: "react-native-unity-view": "^1.2.1" to: "react-native-unity-view": "1.2.1"

alisherakb avatar Jan 05 '19 01:01 alisherakb

@alisherakb Interesting, so that fixed your release builds? I gave it a shot but it did not seem to change anything.

mtostenson avatar Jan 09 '19 20:01 mtostenson

@mtostenson Yes, it solved the issue. Whenever we archive and install .ipa app it was crashing.

alisherakb avatar Jan 10 '19 09:01 alisherakb

@alisherakb Interesting, so that fixed your release builds? I gave it a shot but it did not seem to change anything.

Have you tried to archive .ipa file directly from XCode without Fastlane?

alisherakb avatar Jan 10 '19 13:01 alisherakb

@alisherakb Yes, that is how I tested the empty test project, archived into IPA. May I ask what versions of React Native, Unity, Node, and this library are you using?

mtostenson avatar Jan 10 '19 21:01 mtostenson

@alisherakb Yes, that is how I tested the empty test project, archived into IPA. May I ask what versions of React Native, Unity, Node, and this library are you using?

Sure. RN: 0.57.3 Unity: 2018.1.3f1 Node: v8.15 RN unity view: 1.2.1

P.S. This issue was reproduced and fixed by following above-mentioned solution on Node v10.14.2

alisherakb avatar Jan 10 '19 21:01 alisherakb

Thank you for the help. I'm still not able to get an IPA that doesn't crash. Have you tried using the current version of RN unity view?

mtostenson avatar Jan 11 '19 00:01 mtostenson

Thank you for the help. I'm still not able to get an IPA that doesn't crash. Have you tried using the current version of RN unity view?

No. Have you tried to downgrade? Do you generate main.jsbundle correctly and edit AppDelegate.m to use it in release mode before archiving the project?

react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios

Also, try to set Optimization level in Build Settings to None.

alisherakb avatar Jan 11 '19 21:01 alisherakb

I had problems with iOS Ad-Hoc / App Store Builds too. The app crashed immediately without any useful logs. Setting some compiler flags in XCode worked for me. You could give it a try.

ios/rnunitydemo.xcodeproj/project.pbxproj

COPY_PHASE_STRIP = YES;
ENABLE_BITCODE = NO;
STRIP_INSTALLED_PRODUCT = NO;

JanOwiesniak avatar Jan 12 '19 09:01 JanOwiesniak

@JanOwiesniak I think you solved it. Thank you, I've been trying to fix this for quite a while.

mtostenson avatar Jan 12 '19 18:01 mtostenson

This may point to an underlying issue. @f111fei do you have any idea why this library would require setting "Strip Linked Product" to NO in order to avoid this crash? As far as I understand, all this does is removes the debug symbols from the app.

mtostenson avatar Jan 14 '19 21:01 mtostenson

@JanOwiesniak We found the problem has reappeared in iOS 12.1 even with the workaround. Is your app working on this version?

mtostenson avatar Feb 11 '19 22:02 mtostenson

@mtostenson Have you solved in iOS12.1.4 ?I have the same issue at iphone XS MAX in ios 12.1.4. "Strip Linked Product" to NO, still crashed.

richardlinxj avatar Feb 14 '19 08:02 richardlinxj

We also have the same issue at iphone XS MAX in ios 12.1.4 also ,still crashed, any idea?

peterfei avatar Feb 18 '19 00:02 peterfei

@richardlinxj @peterfei I was able to narrow down where the crash happens in the React Native c++ code. Here's the issue on the React Native Repo. I included a description of how to avoid the crash. In short, you need to hold a reference to the vector that is returned from ModuleRegistry::moduleNames, I just added it as a field in the ModuleRegistry class and that seemed to work. Please join in on the discussion over there.

mtostenson avatar Feb 18 '19 16:02 mtostenson

@mtostenson Thanks for reply , could u give me more information for it ,or some code for

just added it as a field in the ModuleRegistry class

peterfei avatar Feb 19 '19 01:02 peterfei

@mtostenson Thanks for reply , could u give me more information for it ,or some code for

just added it as a field in the ModuleRegistry class

Sure. Add this to ModuleRegistry.h under private:: std::vector<std::string> moduleNamesVec_;

Then in ModuleRegistry.cpp in the getConfig function, change the line moduleNames(); into moduleNamesVec_ = moduleNames();

mtostenson avatar Feb 19 '19 03:02 mtostenson

@mtostenson okay,let me try ~ thank u for a million.

peterfei avatar Feb 19 '19 03:02 peterfei

@mtostenson okay,let me try ~ thank u for a million.

No problem, please let me know if this does anything.

mtostenson avatar Feb 19 '19 03:02 mtostenson

@JanOwiesniak We found the problem has reappeared in iOS 12.1 even with the workaround. Is your app working on this version?

@mtostenson this workaround worked quite well until iPhone XS Max iOS 12.1.4


@mtostenson thanks for the approach, i will give it a try.

JanOwiesniak avatar Feb 19 '19 08:02 JanOwiesniak

@mtostenson i changed following lines in react native (is this correct?)

screen shot 2019-02-19 at 12 00 30

These are crash logs without the above patch. For whatever reasons i don't receive crashlogs anymore. App still does not boot on iPhone XS.

Crashlog A

Crashed: com.facebook.react.JavaScript
0  ???                            0x238e390e4 (Missing)
1  ???                            0x238eb1afc (Missing)
2  ???                            0x63240238d8ffb0 (Missing)
3  ???                            0x66ca8238e8ec7c (Missing)
4  ???                            0x67bb8238e8ee48 (Missing)
5  ???                            0x7d8a8238e802c0 (Missing)
6  ???                            0xfa0238471980 (Missing)
7  ???                            0x4e858102c9f168 (Missing)
8  rnunitydemo                    0x1039d8844 facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
9  rnunitydemo                    0x1039e70d4 facebook::react::JSCNativeModules::createModule(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, OpaqueJSContext const*)
10 rnunitydemo                    0x1039e6c34 facebook::react::JSCNativeModules::getModule(OpaqueJSContext const*, OpaqueJSString*)
11 rnunitydemo                    0x1039e1840 OpaqueJSValue const* (*facebook::react::(anonymous namespace)::exceptionWrapMethod<&(facebook::react::JSCExecutor::getNativeModule(OpaqueJSValue*, OpaqueJSString*))>())(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)::funcWrapper::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)
12 ???                            0x24074083c (Missing)
13 ???                            0x71618240e5ec24 (Missing)
14 ???                            0x210a8240716554 (Missing)
15 ???                            0x7dcf824071b39c (Missing)
16 ???                            0x7503824071b39c (Missing)
17 ???                            0x6047024071b39c (Missing)
18 ???                            0x979024071b39c (Missing)
19 ???                            0x14da824071b39c (Missing)
20 ???                            0x5171024071339c (Missing)
21 ???                            0x4d60240db4cc4 (Missing)
22 ???                            0x5f6b0240fa7ad0 (Missing)
23 ???                            0x885824073e73c (Missing)
24 ???                            0x781801039c1538 (Missing)
25 rnunitydemo                    0x1039df8fc facebook::react::JSCExecutor::loadApplicationScript(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
26 rnunitydemo                    0x1039e5b70 std::__1::__function::__func<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&)
27 rnunitydemo                    0x1037ad298 std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const (functional:1913)
28 rnunitydemo                    0x1039607bc facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
29 rnunitydemo                    0x103956400 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&)
30 ???                            0x23923c354 (Missing)
31 ???                            0x1fa1823923bc38 (Missing)
32 ???                            0x185b0239236f14 (Missing)
33 ???                            0x4ea202392362e8 (Missing)
34 ???                            0x2b3e81039376c4 (Missing)
35 ???                            0x239c38fc0 (Missing)
36 ???                            0x4a270239d75c44 (Missing)
37 ???                            0x4cfb8238eb0974 (Missing)
38 ???                            0x591f8238eb08d0 (Missing)
39 ???                            0x3ffc0238eb8ddc (Missing)

Crashlog B

Crashed: com.facebook.react.JavaScript
0  ???                            0x238e390e4 (Missing)
1  ???                            0x238eb1afc (Missing)
2  ???                            0x10d78238d8ffb0 (Missing)
3  ???                            0x68b58238e8ec7c (Missing)
4  ???                            0x15cb8238e8ee48 (Missing)
5  ???                            0x43980238e802c0 (Missing)
6  ???                            0x79468238471980 (Missing)
7  ???                            0x6426810307f168 (Missing)
8  rnunitydemo                    0x103db8844 facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
9  rnunitydemo                    0x103dc70d4 facebook::react::JSCNativeModules::createModule(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, OpaqueJSContext const*)
10 rnunitydemo                    0x103dc6c34 facebook::react::JSCNativeModules::getModule(OpaqueJSContext const*, OpaqueJSString*)
11 rnunitydemo                    0x103dc1840 OpaqueJSValue const* (*facebook::react::(anonymous namespace)::exceptionWrapMethod<&(facebook::react::JSCExecutor::getNativeModule(OpaqueJSValue*, OpaqueJSString*))>())(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)::funcWrapper::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)
12 JavaScriptCore                 0x24074083c JSC::JSCallbackObject<JSC::JSDestructibleObject>::getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&)
13 ???                            0x300c8240e5ec24 (Missing)
14 ???                            0x30c60240716554 (Missing)
15 ???                            0x57a7024071b39c (Missing)
16 ???                            0xa82024071b39c (Missing)
17 ???                            0x29c2824071b39c (Missing)
18 ???                            0x7aae024071b39c (Missing)
19 ???                            0xa7824071b39c (Missing)
20 ???                            0x78f9824071339c (Missing)
21 ???                            0x5cf18240db4cc4 (Missing)
22 ???                            0x43e80240fa7ad0 (Missing)
23 ???                            0x331e824073e73c (Missing)
24 ???                            0x38fa0103da1538 (Missing)
25 rnunitydemo                    0x103dbf8fc facebook::react::JSCExecutor::loadApplicationScript(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
26 rnunitydemo                    0x103dc5b70 std::__1::__function::__func<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&)
27 rnunitydemo                    0x103b8d298 std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const (functional:1913)
28 rnunitydemo                    0x103d407bc facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
29 rnunitydemo                    0x103d36400 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&)
30 CoreFoundation                 0x23923c354 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
31 ???                            0xc7823923bc38 (Missing)
32 ???                            0x1ca18239236f14 (Missing)
33 ???                            0x63302392362e8 (Missing)
34 ???                            0x3a590103d176c4 (Missing)
35 Foundation                     0x239c38fc0 -[NSThread main]
36 ???                            0x14e88239d75c44 (Missing)
37 ???                            0x37000238eb0974 (Missing)
38 ???                            0x11100238eb08d0 (Missing)
39 ???                            0x4a400238eb8ddc (Missing)

Has anyone any idea what's the issue here and how to solve it? We are already using this in production so this discovery is really painful for us right now :(

JanOwiesniak avatar Feb 19 '19 12:02 JanOwiesniak

@mtostenson i changed following lines in react native (is this correct?)

screen shot 2019-02-19 at 12 00 30

These are crash logs without the above patch. For whatever reasons i don't receive crashlogs anymore. App still does not boot on iPhone XS.

Crashlog A

Crashed: com.facebook.react.JavaScript
0  ???                            0x238e390e4 (Missing)
1  ???                            0x238eb1afc (Missing)
2  ???                            0x63240238d8ffb0 (Missing)
3  ???                            0x66ca8238e8ec7c (Missing)
4  ???                            0x67bb8238e8ee48 (Missing)
5  ???                            0x7d8a8238e802c0 (Missing)
6  ???                            0xfa0238471980 (Missing)
7  ???                            0x4e858102c9f168 (Missing)
8  rnunitydemo                    0x1039d8844 facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
9  rnunitydemo                    0x1039e70d4 facebook::react::JSCNativeModules::createModule(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, OpaqueJSContext const*)
10 rnunitydemo                    0x1039e6c34 facebook::react::JSCNativeModules::getModule(OpaqueJSContext const*, OpaqueJSString*)
11 rnunitydemo                    0x1039e1840 OpaqueJSValue const* (*facebook::react::(anonymous namespace)::exceptionWrapMethod<&(facebook::react::JSCExecutor::getNativeModule(OpaqueJSValue*, OpaqueJSString*))>())(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)::funcWrapper::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)
12 ???                            0x24074083c (Missing)
13 ???                            0x71618240e5ec24 (Missing)
14 ???                            0x210a8240716554 (Missing)
15 ???                            0x7dcf824071b39c (Missing)
16 ???                            0x7503824071b39c (Missing)
17 ???                            0x6047024071b39c (Missing)
18 ???                            0x979024071b39c (Missing)
19 ???                            0x14da824071b39c (Missing)
20 ???                            0x5171024071339c (Missing)
21 ???                            0x4d60240db4cc4 (Missing)
22 ???                            0x5f6b0240fa7ad0 (Missing)
23 ???                            0x885824073e73c (Missing)
24 ???                            0x781801039c1538 (Missing)
25 rnunitydemo                    0x1039df8fc facebook::react::JSCExecutor::loadApplicationScript(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
26 rnunitydemo                    0x1039e5b70 std::__1::__function::__func<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&)
27 rnunitydemo                    0x1037ad298 std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const (functional:1913)
28 rnunitydemo                    0x1039607bc facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
29 rnunitydemo                    0x103956400 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&)
30 ???                            0x23923c354 (Missing)
31 ???                            0x1fa1823923bc38 (Missing)
32 ???                            0x185b0239236f14 (Missing)
33 ???                            0x4ea202392362e8 (Missing)
34 ???                            0x2b3e81039376c4 (Missing)
35 ???                            0x239c38fc0 (Missing)
36 ???                            0x4a270239d75c44 (Missing)
37 ???                            0x4cfb8238eb0974 (Missing)
38 ???                            0x591f8238eb08d0 (Missing)
39 ???                            0x3ffc0238eb8ddc (Missing)

Crashlog B

Crashed: com.facebook.react.JavaScript
0  ???                            0x238e390e4 (Missing)
1  ???                            0x238eb1afc (Missing)
2  ???                            0x10d78238d8ffb0 (Missing)
3  ???                            0x68b58238e8ec7c (Missing)
4  ???                            0x15cb8238e8ee48 (Missing)
5  ???                            0x43980238e802c0 (Missing)
6  ???                            0x79468238471980 (Missing)
7  ???                            0x6426810307f168 (Missing)
8  rnunitydemo                    0x103db8844 facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
9  rnunitydemo                    0x103dc70d4 facebook::react::JSCNativeModules::createModule(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, OpaqueJSContext const*)
10 rnunitydemo                    0x103dc6c34 facebook::react::JSCNativeModules::getModule(OpaqueJSContext const*, OpaqueJSString*)
11 rnunitydemo                    0x103dc1840 OpaqueJSValue const* (*facebook::react::(anonymous namespace)::exceptionWrapMethod<&(facebook::react::JSCExecutor::getNativeModule(OpaqueJSValue*, OpaqueJSString*))>())(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)::funcWrapper::call(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**)
12 JavaScriptCore                 0x24074083c JSC::JSCallbackObject<JSC::JSDestructibleObject>::getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&)
13 ???                            0x300c8240e5ec24 (Missing)
14 ???                            0x30c60240716554 (Missing)
15 ???                            0x57a7024071b39c (Missing)
16 ???                            0xa82024071b39c (Missing)
17 ???                            0x29c2824071b39c (Missing)
18 ???                            0x7aae024071b39c (Missing)
19 ???                            0xa7824071b39c (Missing)
20 ???                            0x78f9824071339c (Missing)
21 ???                            0x5cf18240db4cc4 (Missing)
22 ???                            0x43e80240fa7ad0 (Missing)
23 ???                            0x331e824073e73c (Missing)
24 ???                            0x38fa0103da1538 (Missing)
25 rnunitydemo                    0x103dbf8fc facebook::react::JSCExecutor::loadApplicationScript(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
26 rnunitydemo                    0x103dc5b70 std::__1::__function::__func<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::loadApplication(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_0>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&)
27 rnunitydemo                    0x103b8d298 std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const (functional:1913)
28 rnunitydemo                    0x103d407bc facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
29 rnunitydemo                    0x103d36400 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&)
30 CoreFoundation                 0x23923c354 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
31 ???                            0xc7823923bc38 (Missing)
32 ???                            0x1ca18239236f14 (Missing)
33 ???                            0x63302392362e8 (Missing)
34 ???                            0x3a590103d176c4 (Missing)
35 Foundation                     0x239c38fc0 -[NSThread main]
36 ???                            0x14e88239d75c44 (Missing)
37 ???                            0x37000238eb0974 (Missing)
38 ???                            0x11100238eb08d0 (Missing)
39 ???                            0x4a400238eb8ddc (Missing)

Has anyone any idea what's the issue here and how to solve it? We are already using this in production so this discovery is really painful for us right now :(

I feel your pain on that, our releases have been blocked as well. Your hot fix looks correct, I'm surprised it didn't have the same result for you. I have another suggestion for you, it's not pretty but it can be effective. Looking at your crash log, we should focus on ModuleRegistry::GetConfig. Try putting in a logging line after each statement in that function to find the exact line that result in the crash. Example: syslog(LOG_ERR, "TESTING: ModuleRegistry::getConfig 1"); and increment the number at the end with each line. This is how I was able to find our "fix." Just open up the device console and filter on TESTING when you run the production build. I hope this helps.

mtostenson avatar Feb 19 '19 16:02 mtostenson

@mtostenson thanks for the debugging approach. Sadly i can't run the app on a simulator because we are using a 3rd party library which can not run on the simulator:

Vuforia Engine applications must be deployed to a device to run; they cannot be run in the iOS simulator. You must enroll in the iOS Developer program to deploy applications to an iOS device.

And i don't have access to this particular device in any physical way. Do you have any other idea how to pin that bug down without access to a physical device or the simulator :)

"puts debugging" would mean:

  1. Add debug statement
  2. Archive App via XCode
  3. Upload to Apple App Store Connect (wait ~ 10 minutes until app is "processed")
  4. Deploy App via TestFlight
  5. Call someone who has a iPhone XS, tell him to download the new build via TestFlight and start it
  6. Hope Crashlytics catches the exception (which it does not for whatever reasons in some cases)
  7. Go back to step 1

JanOwiesniak avatar Feb 19 '19 16:02 JanOwiesniak

Sidenote

I just stumbled across Firebase Test Lab and will give it a try. I seems to remove a lot of time consuming steps mentioned earlier.

JanOwiesniak avatar Feb 19 '19 17:02 JanOwiesniak

Update

Firebase Test Lab does not include XS or XR models 🤦‍♂️

test-lab

JanOwiesniak avatar Feb 19 '19 18:02 JanOwiesniak

@mtostenson @JanOwiesniak now i could run it under iPhone XS Max iOS 12.1.4,which use react-native patch yesterday.

peterfei avatar Feb 20 '19 09:02 peterfei

@peterfei which of these commits include the fix?

JanOwiesniak avatar Feb 20 '19 10:02 JanOwiesniak

not found commits from issues, but u reply here like this:

peterfei avatar Feb 20 '19 10:02 peterfei

This works for you? Could you tell me a bit more about your dependencies?

react-native info and current react-native-unity-view would be a great help

JanOwiesniak avatar Feb 20 '19 10:02 JanOwiesniak

hello!

daijiangping avatar Feb 20 '19 10:02 daijiangping