'Expo iOS build crashing on splash screen

I developed an app using Expo and React Native. The app worked fine during development using the Expo Go app, I tested in Android and iOS.

Then I built each app using expo build. The production Android app works fine, but the iOS app crashes within a couple seconds of the splash screen being brought up, both on a real device and when I run a simulator build. I built the iOS app as an archive and it is currently in Test Flight. I was able to deploy previous versions to the app store with no crashes.

I downloaded the crash logs and the last exception reference is:

UIKitCore: -[UIApplication _checkBackgroundRefreshAPIAdoption]

I cannot find a reference to checkBackgroundRefreshAPIAdoption anywhere. The last big change I made was adding MapView functionality, but I have also tried removing all references to the MapView and rebuilding and still run into the same issue.

Edit: forgot to add, I did follow the instructions for deploying a standalone iOS app found here https://docs.expo.dev/versions/latest/sdk/map-view/

Does anyone know what the problem could be?



Solution 1:[1]

I ended up figuring this one out myself. It had nothing to do with the maps api as I thought.

It was actually part of notifications. When I had added notifications to the app I added the UIBackgroundModes property to the infoPlist object under ios in my app.json file. I had put this in as a string but this property needs to be an array of strings.

Here is what I had before: "infoPlist": {"UIBackgroundModes": "remote-notification"}

And this is what I changed it to: "infoPlist": {"UIBackgroundModes": ["remote-notification"]}

The app now loads normally.

Here is the full relevant part of app.json file:

{"expo": { "ios": { "infoPlist": { "UIBackgroundModes": ["remote-notification"] } } } }

Solution 2:[2]

In my case, it was due to missing credential in AndroidManifest.xml file that I forgot to add. I ran adb logcat and found error in the logs thats why the app was crashing on the splash screen.

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR_KEY"/>

Check for misconfiguration by running adb logcat and read logs when your app is crashing

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Ali Abbas