Eas build brokes the app, when classic expo build works just fine

Viewed 956

i have a problem with eas build (expo), My app size is about ~60mb (using expo build:android), and that build is working just fine, (I'am using physically phone).

I've build the same app, no changes, with eas build, there is a crash.

How i run eas build: eas build -p android --profile preview
How i run expo build: expo build:android -t apk

I want to point, I'am not getting any errors when Grandle is runned, and build is just fine

There is my eas.json

{
  "build": {
      
    "preview": {

      "android": {
        "buildType": "apk"
        
      }
    },
    "preview2": {
      "android": {
        "gradleCommand": ":app:assembleRelease"
      }
    },
    "preview3": {
      "developmentClient": true
    },
    "production": {}
  },
  "cli": {
    "version": ">= 0.48.2"
  }
}

How can i check the log of crash? Does someone had something similar? Maybe diffrent solution to make app smaller?

3 Answers

In my case, if an environment variable was missing on first screen the app would crash.

The problem was that I had my variables in an .env file, which will work for the classic build but doesn't in eas build.

If that's your case, you'll need to declare your environment variables in your eas.json file, or create a secret for your app through expo's website for sensitive values.

You can read more about it here: https://docs.expo.dev/build-reference/variables/

I'm having the same problem and working through debugging.

Here's a good place to start -- if you're on mac, connect an android device and run:

adb logcat '*:S' ReactNative:V ReactNativeJS:V

This will help you log relevant errors and debug the issue. Simply running adb logcat logs an unmanageably large amount of data.

Related