iOS app crashes at launch with NSException.

Could anyone help me with this issue? Thanks in advance!

Dependencies:

“dependencies”: {
@expo/samples”: “~3.0.3”,
@expo/vector-icons”: “^10.0.0”,
@react-navigation/web”: “^1.0.0-alpha.9”,
“axios”: “^0.19.0”,
“dayjs”: “^1.8.16”,
“expo”: “^36.0.0”,
“expo-asset”: “~8.0.0”,
“expo-constants”: “~8.0.0”,
“expo-font”: “~8.0.0”,
“expo-web-browser”: “~8.0.0”,
“expokit”: “^36.0.1”,
“md5”: “^2.2.1”,
“prop-types”: “^15.7.2”,
“react”: “16.9.0”,
“react-dom”: “16.9.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz”,
“react-native-gesture-handler”: “~1.5.0”,
“react-native-paper”: “^2.16.0”,
“react-native-rate”: “^1.1.7”,
“react-native-root-toast”: “^3.1.2”,
“react-native-swipe-list-view”: “^2.0.1”,
“react-native-unimodules”: “0.7.0”,
“react-native-web”: “^0.11.7”,
“react-navigation”: “^3.11.0”,
“react-redux”: “^7.1.1”,
“redux”: “^4.0.4”,
“redux-thunk”: “^2.3.0”,
“throttle-debounce”: “^2.1.0”
},
“devDependencies”: {
“babel-preset-expo”: “^8.0.0”,
“jest-expo”: “^36.0.0”
},

Exception detail as follow:

2020-01-28 21:58:33.086192+0800 tovd[29816:2115454] You’ve implemented -[ application:performFetchWithCompletionHandler:], but you still need to add “fetch” to the list of your supported UIBackgroundModes in your Info.plist.
2020-01-28 21:58:33.086275+0800 tovd[29816:2115454] You’ve implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add “remote-notification” to the list of your supported UIBackgroundModes in your Info.plist.
2020-01-28 21:58:33.088846+0800 tovd[29816:2115454] Expo iOS Runtime Version 36.0.0
2020-01-28 21:58:33.090683+0800 tovd[29816:2115831] Expo Remote Notification services won’t work in an ExpoKit app because Expo cannot manage your APNS certificates.
2020-01-28 21:58:33.106192+0800 tovd[29816:2115454] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
“<NSLayoutConstraint:0x60000260a4e0 UIImageView:0x7fa0396067b0.height == 128 (active)>”,
“<NSLayoutConstraint:0x60000260a940 V:|-(>=0)-[UIImageView:0x7fa0396067b0] (active, names: ‘|’:UIView:0x7fa039604230 )>”,
“<NSLayoutConstraint:0x60000260a9e0 V:[UIImageView:0x7fa0396067b0]-(10)-[UIView:0x7fa039604230] (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000260a4e0 UIImageView:0x7fa0396067b0.height == 128 (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2020-01-28 21:58:33.106346+0800 tovd[29816:2115454] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don’t want.
Try this:
(1) look at each constraint and try to figure out which you don’t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
“<NSLayoutConstraint:0x60000260a940 V:|-(>=0)-[UIImageView:0x7fa0396067b0] (active, names: ‘|’:UIView:0x7fa039604230 )>”,
“<NSLayoutConstraint:0x60000260a9e0 V:[UIImageView:0x7fa0396067b0]-(10)-[UIView:0x7fa039604230] (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000260a9e0 V:[UIImageView:0x7fa0396067b0]-(10)-[UIView:0x7fa039604230] (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2020-01-28 21:58:33.121204+0800 tovd[29816:2115454] EXManifestResource: Standalone manifest remote url is http://192.168.1.4:19000 (exp8ffee82087494e8c83ae50a9b6bc08df://192.168.1.4:19000)
2020-01-28 21:58:33.142202+0800 tovd[29816:2115454] EXCachedResource: Not using cache for shell-app-manifest
2020-01-28 21:58:33.275474+0800 tovd[29816:2115822] nw_socket_handle_socket_event [C1:2] Socket SO_ERROR [61: Connection refused]
2020-01-28 21:58:33.275979+0800 tovd[29816:2115822] Connection 1: received failure notification
2020-01-28 21:58:33.276098+0800 tovd[29816:2115822] Connection 1: failed to connect 1:61, reason -1
2020-01-28 21:58:33.276190+0800 tovd[29816:2115822] Connection 1: encountered error(1:61)
2020-01-28 21:58:33.278158+0800 tovd[29816:2115822] Task .<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2020-01-28 21:58:33.288752+0800 tovd[29816:2115822] Task .<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 “Could not connect to the server.” UserInfo={NSUnderlyingError=0x600000b2afa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 “(null)” UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://192.168.1.4:19000/, NSErrorFailingURLKey=http://192.168.1.4:19000/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
2020-01-28 21:58:33.344173+0800 tovd[29816:2115822] *** Terminating app due to uncaught exception ‘ExpoFatalError’, reason: ‘Expo encountered a fatal error: Make sure you are serving your project with Expo CLI (Could not connect to the server.)’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 tovd 0x000000010eba17f9 -[EXAppViewController maybeShowError:] + 1113
3 tovd 0x000000010eba2e6d -[EXAppViewController appLoader:didFailWithError:] + 317
4 tovd 0x000000010eb9a464 -[EXAppLoader appFetcher:didFailWithError:] + 180
5 tovd 0x000000010eb96c1e -[EXAppFetcherDevelopmentMode _finishWithError:] + 398
6 tovd 0x000000010eb964c7 __36-[EXAppFetcherDevelopmentMode start]_block_invoke.9 + 87
7 tovd 0x000000010eb9b237 __62-[EXAppLoader fetchManifestWithCacheBehavior:success:failure:]_block_invoke.193 + 727
8 tovd 0x000000010eba6fb6 __71-[EXCachedResource _loadRemoteResourceWithSuccess:error:ignoringCache:]_block_invoke.54 + 166
9 tovd 0x000000010ebb3968 __64-[EXFileDownloader downloadFileFromURL:successBlock:errorBlock:]_block_invoke + 504
10 CFNetwork 0x00007fff22d9a1f8 CFNetwork + 37368
11 CFNetwork 0x00007fff22dad3a6 _CFHTTPMessageSetResponseProxyURL + 16819
12 Foundation 0x00007fff25752d51 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 7
13 Foundation 0x00007fff25752c49 -[NSBlockOperation main] + 98
14 Foundation 0x00007fff25755bd6 NSOPERATION_IS_INVOKING_MAIN + 17
15 Foundation 0x00007fff25751e49 -[NSOperation start] + 731
16 Foundation 0x00007fff25756530 NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION + 17
17 Foundation 0x00007fff2575603a __NSOQSchedule_f + 182
18 libdispatch.dylib 0x0000000110f3f3c9 _dispatch_block_async_invoke2 + 83
19 libdispatch.dylib 0x0000000110f30d48 _dispatch_client_callout + 8
20 libdispatch.dylib 0x0000000110f336ba _dispatch_continuation_pop + 552
21 libdispatch.dylib 0x0000000110f32ac5 _dispatch_async_redirect_invoke + 849
22 libdispatch.dylib 0x0000000110f4228c _dispatch_root_queue_drain + 351
23 libdispatch.dylib 0x0000000110f42b96 _dispatch_worker_thread2 + 132
24 libsystem_pthread.dylib 0x00007fff5245f6b3 _pthread_wqthread + 583
25 libsystem_pthread.dylib 0x00007fff5245f3fd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Exactly the same error here.
<NSLayoutConstraint:0x280c7f890 V:[UIImageView:0x106a0e6d0]-(10)-[UIView:0x106a09f20] (active)>
“Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger”
Although I don’t know how to use the XCode debugger with an Expo project. I guess I will have to eject to ExpoKit or something like that?
Any answer or pointers on how to debug native swift code would be great. This is happening when I try to run the app in TestFlight.
Thanks a bunch in advance!
/G

Ok. So I managed to get some relevant crashlogs from building the app for the simulator and then installing it there (on the simulator).
Heres the guide I followed:

We seem to not exactly have the same issue since you’re running ExpoKit but my spontaneous thought is that you have some issues in your app.json since it’s complaining about your plist.
If you can’t solve the issue, go ahead and submit your app.json and I can check that out. Maybe you’re missing a dependency in there.

Sure, I set up another two dependent capabilities in Xcode to fix the warning threw by the exception. But it seems these problems are not the critical ones. The content of my app.json is shown below.

{
  "expo": {
    "name": "TOVD",
    "slug": "TOVDiary",
    "privacy": "public",
    "sdkVersion": "36.0.0",
    "description": "A mobile app used for taking notes.",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "version": "1.0.2",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0,
      "enabled": true,
      "checkAutomatically": "ON_LOAD"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.yhspy.tovd",
      "publishBundlePath": "ios/tovd/Supporting/shell-app.bundle",
      "publishManifestPath": "ios/tovd/Supporting/shell-app-manifest.json"
    },
    "android": {
      "package": "com.yhspy.tovd",
      "publishBundlePath": "android/app/src/main/assets/shell-app.bundle",
      "publishManifestPath": "android/app/src/main/assets/shell-app-manifest.json"
    },
    "isDetached": true,
    "detach": {
      "iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.13.0-sdk35.0.0-a30ebc9b-3db4-42f4-b677-e468076baf18.tar.gz",
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.13.0-sdk35.0.0-b816b7af-88da-4ca9-87a5-7438f0c21b6e.tar.gz"
    },
    "scheme": "exp8ffee82087494e8c83ae50a9b6bc08df"
  }
}

It looks like this is the relevant part of the error:

2020-01-28 21:58:33.275474+0800 tovd[29816:2115822] nw_socket_handle_socket_event [C1:2] Socket SO_ERROR [61: Connection refused]
2020-01-28 21:58:33.275979+0800 tovd[29816:2115822] Connection 1: received failure notification
2020-01-28 21:58:33.276098+0800 tovd[29816:2115822] Connection 1: failed to connect 1:61, reason -1
2020-01-28 21:58:33.276190+0800 tovd[29816:2115822] Connection 1: encountered error(1:61)
2020-01-28 21:58:33.278158+0800 tovd[29816:2115822] Task .<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2020-01-28 21:58:33.288752+0800 tovd[29816:2115822] Task .<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 “Could not connect to the server.” UserInfo={NSUnderlyingError=0x600000b2afa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 “(null)” UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://192.168.1.4:19000/, NSErrorFailingURLKey=http://192.168.1.4:19000/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
2020-01-28 21:58:33.344173+0800 tovd[29816:2115822] *** Terminating app due to uncaught exception ‘ExpoFatalError’, reason: ‘Expo encountered a fatal error: Make sure you are serving your project with Expo CLI (Could not connect to the server.)’

I’m not sure what an ejected app does exactly. I assume this is in debug mode, since it’s trying to connect to 192.168.1.4:19000.

It’s getting a Connection refused error which implies that either there’s nothing listening on port 19000 (you could try running lsof -i :19000 or netstat -p tcp -an | grep 19000 to check) or else whatever is listening on port 19000 is bound to e.g. localhost when the app needs to connect to 192.168.1.4 instead.

There’s also a possibility you have a firewall blocking access to that port on that IP address.

Yes, I retried with some fixes and got the following error, it looks like this is the most critical one “Unable to simultaneously satisfy constraints.

2020-02-01 22:50:53.697984+0800 tovd[53560:5085274] Expo iOS Runtime Version 36.0.0
2020-02-01 22:50:53.700318+0800 tovd[53560:5086319] Expo Remote Notification services won't work in an ExpoKit app because Expo cannot manage your APNS certificates.
2020-02-01 22:50:53.719377+0800 tovd[53560:5085274] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x60000189d2c0 UIImageView:0x7f89f7d127b0.height == 128   (active)>",
    "<NSLayoutConstraint:0x6000018f4140 V:|-(>=0)-[UIImageView:0x7f89f7d127b0]   (active, names: '|':UIView:0x7f89f7d11f30 )>",
    "<NSLayoutConstraint:0x6000018f41e0 V:[UIImageView:0x7f89f7d127b0]-(10)-[UIView:0x7f89f7d11f30]   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000189d2c0 UIImageView:0x7f89f7d127b0.height == 128   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2020-02-01 22:50:53.719641+0800 tovd[53560:5085274] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x6000018f4140 V:|-(>=0)-[UIImageView:0x7f89f7d127b0]   (active, names: '|':UIView:0x7f89f7d11f30 )>",
    "<NSLayoutConstraint:0x6000018f41e0 V:[UIImageView:0x7f89f7d127b0]-(10)-[UIView:0x7f89f7d11f30]   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000018f41e0 V:[UIImageView:0x7f89f7d127b0]-(10)-[UIView:0x7f89f7d11f30]   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2020-02-01 22:50:53.739265+0800 tovd[53560:5085274] EXManifestResource: Standalone manifest remote url is http://192.168.1.4:19000 (exp8ffee82087494e8c83ae50a9b6bc08df://192.168.1.4:19000)
2020-02-01 22:50:53.782698+0800 tovd[53560:5085274] EXCachedResource: Not using cache for shell-app-manifest
2020-02-01 22:50:54.024138+0800 tovd[53560:5086310] *** Terminating app due to uncaught exception 'ExpoFatalError', reason: 'Expo encountered a fatal error: Make sure you are serving your project with Expo CLI (The experience you requested requires a newer version of the Expo Client app. Please download the latest version from the App Store.)'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
	2   tovd                                0x000000010e7697f9 -[EXAppViewController maybeShowError:] + 1113
	3   tovd                                0x000000010e76ae6d -[EXAppViewController appLoader:didFailWithError:] + 317
	4   tovd                                0x000000010e762464 -[EXAppLoader appFetcher:didFailWithError:] + 180
	5   tovd                                0x000000010e75ec1e -[EXAppFetcherDevelopmentMode _finishWithError:] + 398
	6   tovd                                0x000000010e75e4c7 __36-[EXAppFetcherDevelopmentMode start]_block_invoke.9 + 87
	7   tovd                                0x000000010e763237 __62-[EXAppLoader fetchManifestWithCacheBehavior:success:failure:]_block_invoke.193 + 727
	8   tovd                                0x000000010e794070 __85-[EXManifestResource loadResourceWithBehavior:progressBlock:successBlock:errorBlock:]_block_invoke + 2176
	9   tovd                                0x000000010e76ee3b __71-[EXCachedResource _loadRemoteResourceWithSuccess:error:ignoringCache:]_block_invoke + 203
	10  tovd                                0x000000010e77b994 __64-[EXFileDownloader downloadFileFromURL:successBlock:errorBlock:]_block_invoke + 548
	11  CFNetwork                           0x00007fff22d9a1f8 CFNetwork + 37368
	12  CFNetwork                           0x00007fff22dad3a6 _CFHTTPMessageSetResponseProxyURL + 16819
	13  Foundation                          0x00007fff25752d51 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
	14  Foundation                          0x00007fff25752c49 -[NSBlockOperation main] + 98
	15  Foundation                          0x00007fff25755bd6 __NSOPERATION_IS_INVOKING_MAIN__ + 17
	16  Foundation                          0x00007fff25751e49 -[NSOperation start] + 731
	17  Foundation                          0x00007fff25756530 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 17
	18  Foundation                          0x00007fff2575603a __NSOQSchedule_f + 182
	19  libdispatch.dylib                   0x0000000110b073c9 _dispatch_block_async_invoke2 + 83
	20  libdispatch.dylib                   0x0000000110af8d48 _dispatch_client_callout + 8
	21  libdispatch.dylib                   0x0000000110afb6ba _dispatch_continuation_pop + 552
	22  libdispatch.dylib                   0x0000000110afaac5 _dispatch_async_redirect_invoke + 849
	23  libdispatch.dylib                   0x0000000110b0a28c _dispatch_root_queue_drain + 351
	24  libdispatch.dylib                   0x0000000110b0ab96 _dispatch_worker_thread2 + 132
	25  libsystem_pthread.dylib             0x00007fff5245f6b3 _pthread_wqthread + 583
	26  libsystem_pthread.dylib             0x00007fff5245f3fd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

I think that is a warning. The actual crash seems to be caused by this:

2020-02-01 22:50:53.739265+0800 tovd[53560:5085274] EXManifestResource: Standalone manifest remote url is http://192.168.1.4:19000 (exp8ffee82087494e8c83ae50a9b6bc08df://192.168.1.4:19000)
2020-02-01 22:50:53.782698+0800 tovd[53560:5085274] EXCachedResource: Not using cache for shell-app-manifest
2020-02-01 22:50:54.024138+0800 tovd[53560:5086310] *** Terminating app due to uncaught exception 'ExpoFatalError', reason: 'Expo encountered a fatal error: Make sure you are serving your project with Expo CLI (The experience you requested requires a newer version of the Expo Client app. Please download the latest version from the App Store.)'

i.e.:

Expo encountered a fatal error: Make sure you are serving your project with Expo CLI (The experience you requested requires a newer version of the Expo Client app. Please download the latest version from the App Store.)

But this is a bit confusing because you have ejected, right?

Unfortunately I have never tried ejecting an app before so I’m not sure how development works after you’ve ejected. Could you explain how you’re running the app etc? Are you running on a physical device or on the Simulator? Do you run yarn ios? Are you opening the project with the Expo client?

Yes, exactly.

I tried re-ejecting the iOS part and installing the app on a simulator. But unfortunately, the same exception was thrown.

@llamaluvr, any idea what might be going on here, since you actually develop an ExpoKit app? :slight_smile:

Fixed. It seems like I didn’t build the bundle script file.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.