expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Home Page:https://docs.expo.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[expo-updates] Disable expo-updates in app.json make iOS app crash at launch.

Patafix opened this issue · comments

Summary

If we disabled expo-updates in app.json, iOS app crash at launch.

Some native relevant crash log :

Thread 0 name:
Thread 0 Crashed:
0 XXX 0x000000010431b3a4 Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value + 0 (ExpoUpdatesReactDelegateHandler.swift:0)
1 XXX 0x000000010431b3a4 specialized ExpoUpdatesReactDelegateHandler.appController(:didStartWithSuccess:) + 980 (ExpoUpdatesReactDelegateHandler.swift:80)
2 XXX 0x000000010431b0bc specialized ExpoUpdatesReactDelegateHandler.appController(
:didStartWithSuccess:) + 236 (ExpoUpdatesReactDelegateHandler.swift:78)
3 XXX 0x000000010431a9e4 appController + 4 (:0)
4 XXX 0x000000010431a9e4 @objc ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 48

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

44

Environment

Expo CLI 5.0.3 environment info:
System:
OS: Linux 5.13 Freedesktop.org 20.08.14 (Flatpak runtime) 20.08.14 (Flatpak runtime)
Shell: 5.1.8 - /bin/sh
Binaries:
Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
npm: 8.3.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
npmPackages:
@expo/metro-config: ^0.1.49 => 0.1.84
expo: ^44.0.0 => 44.0.1
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
eas-cli: 0.43.0
Expo Workflow: managed

Reproducible demo

In app.json:

updates: {
        enabled: false,
        fallbackToCacheTimeout: 0,
    },

The app work fine with :

updates: {
        fallbackToCacheTimeout: 0,
    },

if you're reading this and want to disable expo-updates but this is blocking you, you can just uninstall expo-updates. this also works fine in managed apps in sdk 44+, where expo-updates is not installed automatically as part of the build process anymore.

if you're reading this and want to disable expo-updates but this is blocking you, you can just uninstall expo-updates. this also works fine in managed apps in sdk 44+, where expo-updates is not installed automatically as part of the build process anymore.

besides that, we may release new expo-updates with the fix next week. in case someone wants to have expo-updates installed but disable it, waiting the new release is also an alternative. i'll update here once we release new expo-updates.

Hey,
I have the same issue, but expo-updates is enabled and I need it because I am using sentry. It was working locally on the simulator and I have this error when I submit my app on TestFlight...
Here is the log I have, does someone can help me please ? Thank youuu

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000104c6a94c
Exception Note:  EXC_CORPSE_NOTIFY
Terminating Process: exc handler [5966]
Triggered by Thread:  0


Kernel Triage:
VM - pmap_enter failed with resource shortage


Thread 0 name:
Thread 0 Crashed:
0   TrainityMobileReactNative     	0x0000000104c6a94c Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value + 0 (ExpoUpdatesReactDelegateHandler.swift:0)
1   TrainityMobileReactNative     	0x0000000104c6a94c specialized ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 980 (ExpoUpdatesReactDelegateHandler.swift:80)
2   TrainityMobileReactNative     	0x0000000104c6a664 specialized ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 236 (ExpoUpdatesReactDelegateHandler.swift:78)
3   TrainityMobileReactNative     	0x0000000104c69f8c appController + 4 (<compiler-generated>:0)
4   TrainityMobileReactNative     	0x0000000104c69f8c @objc ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 48
5   TrainityMobileReactNative     	0x0000000104c4876c __73-[EXUpdatesAppController appLoaderTask:didFinishWithLauncher:isUpToDate:]_block_invoke + 52 (EXUpdatesAppController.m:252)
6   libdispatch.dylib             	0x000000018090d924 _dispatch_call_block_and_release + 32 (init.c:1517)
7   libdispatch.dylib             	0x000000018090f670 _dispatch_client_callout + 20 (object.m:560)
8   libdispatch.dylib             	0x000000018091db70 _dispatch_main_queue_callback_4CF + 944 (inline_internal.h:2601)
9   CoreFoundation                	0x0000000180c55d84 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
10  CoreFoundation                	0x0000000180c0ff5c __CFRunLoopRun + 2540 (CFRunLoop.c:3144)
11  CoreFoundation                	0x0000000180c23468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
12  GraphicsServices              	0x000000019c7ae38c GSEventRunModal + 164 (GSEvent.c:2200)
13  UIKitCore                     	0x00000001835c5088 -[UIApplication _run] + 1100 (UIApplication.m:3493)
14  UIKitCore                     	0x0000000183343958 UIApplicationMain + 2092 (UIApplication.m:5046)
15  TrainityMobileReactNative     	0x0000000104c2fa0c main + 88 (main.m:7)
16  dyld                          	0x0000000105139aa4 start + 520 (dyldMain.cpp:879)

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!
Bare

What platform(s) does this occur on?
iOS

SDK Version (managed workflow only)
44

@Lauwed could you share your AppDelegate.m for troubleshooting?

@Kudo I managed to resolve my problem. I don't think it's gonna help a lot of people, but I share it anyway if it can help.

Basically, I had a problem with bridges and this error appeared while running on iOS

RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks

I was able to resolve this by using the solution of this guy on Stack Overflow. The thing is, I override this line

RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:nil];

by the one, Hussain Pettiwala was given in his solution

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Test" initialProperties:nil];

I only had to put back the original line and everything is working fine now.

Have a great dayyy

this is released in expo-updates@0.11.6

commented

I've just updated to SDK 45 and I'm facing the same issue in a managed workflow with eas build, the app crashes on start, this is the error log:

0x000000010302da24 -[RCTBridge setUp] + 48 (RCTBridge.m:365)
0x000000010302d230 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] + 236 (RCTBridge.m:231)
0x0000000102f176dc init + 20 (<compiler-generated>:0)
0x0000000102f176dc init + 32 (ExpoUpdatesReactDelegateHandler.swift:0)
0x0000000102f176dc specialized ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 196
0x0000000102f16d44 appController + 8 (<compiler-generated>:0)
0x0000000102f16d44 @objc ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 52
0x0000000102ef33fc __73-[EXUpdatesAppController appLoaderTask:didFinishWithLauncher:isUpToDate:]_block_invoke + 52 (EXUpdatesAppController.m:262)

and this is my package.json:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "build-submit": "eas build -p ios --profile diritto --auto-submit",
    "build-old-submit": "npx cross-env APP_ENV=diritto expo build:ios --no-wait -t archive"
  },
  "dependencies": {
    "@expo/ngrok": "^4.1.0",
    "@expo/metro-config": "^0.3.18",
    "@react-native-async-storage/async-storage": "^1.17.3",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-navigation/drawer": "^5.12.9",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.9",
    "expo": "^45.0.0",
    "expo-ads-admob": "~13.0.0",
    "expo-constants": "~13.1.1",
    "expo-device": "^4.2.0",
    "expo-linear-gradient": "^11.3.0",
    "expo-linking": "^3.1.0",
    "expo-splash-screen": "^0.15.1",
    "expo-store-review": "^5.2.0",
    "firebase": "^9.6.11",
    "prop-types": "^15.7.2",
    "react": "17.0.2",
    "react-native": "0.68.2",
    "react-native-chart-kit": "^6.11.0",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-svg": "^12.3.0",
    "sentry-expo": "^4.2.0"
  },
  "devDependencies": {
    "babel-preset-expo": "^9.1.0",
    "eslint-config-handlebarlabs": "^0.0.6",
    "prettier": "^2.7.1",
    "react-devtools": "^4.24.7",
    "react-native-debugger": "^1.1.0"
  },
  "private": true
}

It works fine with old build method but with eas build it doesn't work at all, I've tried with app.json
updates: {enabled: false} and removing expo-updates from package.json as suggested from @brentvatne but didn't work.

I'm having the same problema after update to Expo48.
Someone have some a light to resolve this?

Here is part o the log crash with the problem:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libswiftCore.dylib 0x18f70f568 assertionFailure(::file:line: flags:) + 304
1 MyApp 0x102f323d4 specialized ExpoUpdatesReactDelegateHandler.appController(
:didStartWithSuccess:) + 1036
2 MyApp 0x102f3163c @objc ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 52
3 MyApp 0x102f11d78 __73-[EXUpdatesAppController appLoaderTask:didFinishWithLauncher:isUpToDate:]_block_invoke + 44
4 libdispatch.dylib 0x18010d244 _dispatch_call_block_and_release + 24
5 libdispatch.dylib 0x18010ea98 _dispatch_client_callout + 16
6 libdispatch.dylib 0x18011c41c _dispatch_main_queue_drain + 976
7 libdispatch.dylib 0x18011c03c _dispatch_main_queue_callback_4CF + 40
8 CoreFoundation 0x180361c2c CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
9 CoreFoundation 0x18035c0b0 __CFRunLoopRun + 2432
10 CoreFoundation 0x18035b218 CFRunLoopRunSpecific + 572
11 GraphicsServices 0x18c25f60c GSEventRunModal + 160
12 UIKitCore 0x184d88a98 -[UIApplication _run] + 992
13 UIKitCore 0x184d8d634 UIApplicationMain + 112
14 MyApp 0x102e79f08 main + 80 (main.m:7)
15 dyld_sim 0x1046a1cd8 start_sim + 20
16 dyld 0x104955f28 start + 2236