6

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?

fvzacole
  • 61
  • 1
  • 2
  • I got same error. I don't know how to debug. expo SDK 45.0.0. Build show no error. App crash in physical device. – Four May 28 '22 at 14:00

4 Answers4

3

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/

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
1

Maybe any logs?

I've had 1 problem regarding Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. **EXPO.dev** and I'm working with Firebase, then the problem was about .gitignore having google-service.json and .env, which as per this comment are not uploaded in the EAS Build.

Daniel Danielecki
  • 8,508
  • 6
  • 68
  • 94
0

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.

Andrew Fredette
  • 191
  • 2
  • 9
0

The issue and the answer are actually in this post, but I'll outline it here briefly.

I had the same issue with undefined .env variables. The issue is that the files in your .gitignore file aren't uploaded to eas machine that assembles your build. But you can create .easignore file that would be a copy of your .gitignore file excluding your .env file.

Aliaksei
  • 1,094
  • 11
  • 20