Why does my Expo app run in Expo Go but not as a development build?
Asked Answered
H

3

7

I've created a development build of an Expo app using EAS. Previously I would open the app in Expo Go by running npx expo start and scanning the Metro Bundler QR code.

Now, when I try to do the same thing, Expo Go asks whether I want to open the project in Expo Go or as a "Development Build". It works fine in Expo Go, but crashes immediately when I attempt to open the dev build. The error reads:

null is not an object (evaluating '_ReanimatedModule.default.createNode')

This error is suspiciously similar to one that I encountered earlier in development, which I resolved by downgrading to React Native version 0.69.6. I'm also encountering a second error that says "'main' has not been registered", but I suspect this is downstream of the first error.

I have the same issue when I try to run the app with npx expo start --dev-client.

Any ideas why I might be having this problem?

Holbrook answered 26/11, 2022 at 15:9 Comment(1)
Same problem here. No solutions so far.Minster
P
5

It sounds like you may have run expo prebuild (https://docs.expo.dev/workflow/prebuild/) which removes "main": "node_modules/expo/AppEntry.js", from app.json. Try to create a new expo app and look at it's app.json file.

When you run expo prebuild it changes a few things with your project (see "side effects" in the prebuild docs).

I'm actually working through some issues with that right now too. I thought I had to run prebuild but turns out I didn't have to. Ever since I ran it my app will not load via the dev-client way. I can however switch back to npx expo start (NOT npx expo start --dev-client, see the scripts section of app.json as that is also changed when prebuild is run).

Let me know if you are able to get your app to load after re-adding the main stuff to app.json.

Ps, are you by chance using react-native-google-mobile-ads?

Paramecium answered 10/12, 2022 at 17:27 Comment(7)
That worked for me, except that I put the main inside package.json, not app.json!Schmeltzer
How would this work with expo-router/entry file based routing system?Skiascope
I'm using react-native-google-mobile-ads, facing the same issue, any tips?Substitution
@PauloLima Make sure you have a valid ios_app_id and android_app_id in app.json. "react-native-google-mobile-ads": { "android_app_id": "ca-app-pub-********~********", "ios_app_id": "ca-app-pub-********~********" }Paramecium
In case anyone stumbles on the same question as @conor909, set the following in your package.json: "main": "expo-router/entry". That worked for me.Exam
based on my observations, for expo@^50 it doesn't change entry etc., but only looks if expo-dev-client is present as an installed dependency. That is, if it is, expo start will target native dev builds, not Expo Go; which I wanted to temporarily avoid to test on iOS simulator with Expo Go, so I just removed expo-dev-client dependency and it worked.Interdiction
@PauloLima Have you managed to find a solution? I have the same issueBrann
L
1

Not sure if this is relevant anymore, but for me what worked was uninstalling expo-dev-client package.

Layette answered 9/8 at 19:22 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Izak
M
0

I had the same issue, I simply rebuild using EAS with this command

eas build --platform android --profile development

you can follow these steps

Morten answered 30/8 at 2:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.