App works fine in Expo-Go but doesn't work after eas build

  1. SDK Version: 46
  2. Platform: Android
  3. Eas: 2.6.0

I have a simple app which uses react navigation v6. It doesn’t use any other heavy third party libraries. All its using is react-navigation-v6. It works totally fine in Expo-Go during development but when i build a development apk with eas build it is stuck on loading screen always. The loading screen is my custom built component which i show at start to get data and authenticate user.

This is the command i use for building:

eas build --platform android --profile preview2

In the preview2 profile i have set buildtype to apk

Hi @nasyxrakeeb

Please see the following page:

In particular, when something works in development but not in production, try this:

Hint: Sometimes, running your app in “production mode” locally will show errors that normally wouldn’t be thrown. You can run an app locally in production by running npx expo start --no-dev --minify. “–no-dev” tells the server not to be run in development mode, and “–minify” will minify your code the same way it is for production JavaScript bundles.

but also see the info on the rest of the page.

The default build type for the preview profile is already “apk” :slight_smile:

1 Like

Thanks for the answer, but i had manually configure eas in my project and set buildtype to apk preview. So it wasn’t already there.

Yes, it’s an implicit default. If you delete eas.json and run eas build:configure then it will generate the default eas.json. You will see that there is no buildType specified, however, the development and preview profiles will build an APK, and the production profile will build an AAB.

It will not cause problems if you explicitly set buildType, though.

1 Like

I tried to run the app locally with above command, but its also stuck now locally with this command. and it doesn’t throw any errors

OK, good. So you can reproduce the error locally.

Now, since it’s not throwing errors you would need to try to track it down by doing something like this: fyi/ at main · expo/fyi · GitHub