iOS app is getting crashed on Launch in testflight

My iOS app is getting crashed on Launch in testflight and below is the cashed error which I am getting.

Error Details:

Any support is appropriated and let me know for any more details.

I’m also getting this error. The last update I made to pods and packages was last Friday, and have released to TestFlight 4 times since. My latest version is now giving this error. I disabled ExpoUpdates in the .plist file set it to “NEVER.” The crash logs don’t do me any justice. It just crashes the moment I select the app.

I have the same issue the app crashes at the splash screen.
I running Expo SDK 47, React Native 0.70.5, React 18.1.0

What versions do you have?

I cannot decipher the logs as there is no information for which function or line number the error
is happening in my app??

expo SDK 46, React Native 0.69.6 and React 18.0.0

I’m currently upgrading to 47, to upgrade to 48 to see if that resolves the problem.

Let me know how it goes plz?

@technology_eate Please let us know here if you are able to resolve the issue.

@malcolmds @neetesh as of right now, it’s looking terrible. I can’t get xcode to build. I couldn’t get my app to load because of 2 react native views being imported. This post in expo’s github recommends doing an “expo prebuild --clean” to get updated contents. I attempted that, but so how many files and configurations I did were lost. I immediately discarded those changes. I’m going to power through and resolve my issues with expo 48 since they’re deprecating 46 when 49 comes out. I’ll continue posting what I find.

@technology_eate

Why are you using xcode to build?
Isnt it a Expo SDK managed workflow app?
Arent you using EAS to build and submit to stores?

@malcolmds
I am using below verisons:
React Version - 18.0.0
React Native Version - 0.69.6
Expo Verison - 46.0.9
eas-cli Version - 3.7.2

Hi @malcolmds

It seems that technology_eate is using the Bare workflow. But sometimes it can help to use Xcode locally to troubleshoot build issues. In order to do that you would basically temporarily switch to the Bare workflow by running npx expo prebuild and then later switch back to the Managed workflow by reverting the changes made by prebuild (the main thing is to delete the generated ios and android directories.)

It’s possible to use EAS Build to build React Native apps and then EAS Submit to submit them to the stores.

@wodin Any Idea why the app is getting crashed in testflight while I am using EAS setup to create & submit the build.

Also FYI, app is working fine in expo app.

All that does is it deletes the ios and android directories and regenerates them from scratch. So yes, if you’ve made your own changes to the native projects then npx expo prebuild --clean will trash those.

It might still make sense to do that if you can first note what changes you made to the native projects and then re-apply those changes after running npx expo prebuild --clean, but of course that might not be easy depending on what and how many changes you’ve made.

e.g. see Adopting Prebuild

Hi @neetesh

Have you tried checking the Troubleshooting build errors and crashes documentation and also the Debugging Runtime Issues guide?

If it works for you in Expo Go, then first make sure you do not have ios or android directories in your app, because you don’t need them and they could be out of sync with your app.json or your dependencies.

Then it’s worth checking for possible problems with versions of your dependencies. This might not be anything to do with your problem, but it won’t hurt to try it. Run npx expo-doctor and see if it warns about anything. If so you probably want to fix what it complains about.

Even if expo-doctor is happy there can still be some dependency issues, because expo-doctor is not perfect. What has helped me in the past is to do this:

  • Remove node_modules and yarn.lock or package-lock.json
  • Reinstall the dependencies with yarn or npm install (depending on which tool you are using, of course)
  • Re-run npx expo-doctor to check for any issues that might have been introduced by doing the above

Then as mentioned in the debugging guide, you can try to make your development environment closer to the production environment by running npx expo start --no-dev --minify and see if you do get the problem in Expo Go now. If so, you can debug it locally.

Unfortunately I don’t have much experience with debugging this sort of issue with iOS apps, but hopefully the guides mentioned above will point you in the right direction.

@wodin I have implemented the suggested steps but there is no success yet.

The crash log indicates that the app has crashed on an iPhone with model number “iPhone12,1” running iOS version 16.1.2. The crash occurred on March 15, 2023, at 13:46:10 local time. The crash was triggered by thread 2 and resulted in an EXC_CRASH signal with Exception Codes of 0x0000000000000000, 0x0000000000000000.

The kernel tinge section indicates that the crash occurred due to a resource shortage while trying to enter a memory mapping. Specifically, the VM - pmap_enter function was retried due to the shortage of resources. This suggests that the app may be using too much memory or other system resources, causing the system to run out of available resources and resulting in a crash.

Above 2 paragraphs are taken from chatGPT answer after submitting the log details.

And it’s the same phone that runs Expo Go no problem?

All I can suggest is maybe create a new app and add all your dependencies but not the JavaScript code and build it a put it on test flight. Does that crash in the same way?

If not, start copying the JavaScript across a bit at a time. (Or maybe copy all of the JavaScript to start with and see if it crashes now. If it does crash, try removing/commenting out about half of the JavaScript and test again.)

In this way, by adding/removing code and dependencies you should hopefully be able to narrow down where the problem is coming from.

i.e. try some “manual debugging”

yes same phone where expo go app is working fine.

Let me try manual debugging and check. Thanks for your support.

1 Like

@wodin @neetesh I always get confused as to which workflow because we code in javascript/typescript and work on expo go, and not in xcode. Per Expo’s Bare vs. Managed workflow, it says I’m managed. The app just has 3rd party libraries that need to be configured so that it can be compiled and built via EAS build, so that’s where I now see that I’m Bareflow. Before every release, I do a sanity test to make sure it can compile and run via xcode and android studio, then deploy.

Now that the backstory is out of the way. Last Friday, we added Sentry.io to the app. Per the documentation, Using Sentry - Expo Documentation, Did the wizard, added the publishHook, and things worked fine until yesterday.

I think having both managed, and bare, workflow implementations in the app finally caught up to us. I did the bare workflow only. I saw in the “Bundle React Native code and images” build phase 2 extra lines added from the wizard. 1 for sentry.properties, and the other for outputting sourcemaps. I removed the sourcemaps line from it. After doing an internal distribution and app store builds, I was able to successfully open up the app without crashing immediately. However, I had commented out the Sentry.init logic in my app.js, so I’ll do another build with that to make sure.

@neetesh, I know that you’re managed, so my solution will not be of service for you. If possible, still try doing an upgrade. Despite me resolving the my problem, I’m still moving to 48 while I have the energy and time.

@technology_eate: I tried manual debugging but I can’t go very deep in my code to remove and check.

I am still facing the issue and now I came to know that same issue is occurring in Android too and app is getting crashed on launch :frowning:

As I found that there might be some memory issue due to heavy images used on home screen but after removing those images, issue didn’t get solved.

I am still figuring out the solution and will update here as soon as I found some fix also looking forward to you and @malcolmds if you guys found any solution.

Hello @technology_eate & @malcolmds,

I am able to fix the issue for both Android & iOS just be installing below package:
react-native-screens

Now my app is working fine in both platforms.
I would suggest to try above solution and let me know if you guys able to fix your issue.

2 Likes

If your app works in Expo Go without having to avoid certain code when in dev mode or something like that, then you do not need the ios or android directories. If you have ios and android directories then you are effectively in the Bare workflow. While “Prebuild” made Expo much more powerful, it has complicated things a bit, because now there’s sort of an intermediate thing between managed and bare where you can have the native projects, but regenerate them with npx expo prebuild --clean

OK. If you have config plugins for these third party libraries, then you still do not need the ios and android directories, because the build server will automatically run prebuild for you when you build and the config plugins that run during that process will do the necessary configuration.

But I am a bit confused about this. If your app works in Expo Go, then presumably it would crash or not work correctly when it tried to call these third party libraries, since they are not compiled into Expo Go.

What are these third party libraries? Do you have config plugins for them? How have you configured them? Do you have something in the app that allows you to avoid calling the third party libraries when running in Expo Go or something like that?

That’s the thing, though. You are currently in the Bare workflow. I think that assuming that you were somehow (partially?) in the managed workflow is contributing to the problems.