Search code examples
buildexpoapk

Build APK from bare workflow Expo project with native local (offline) module


When building the project with EAS an error is showed:

no such file or directory, open ‘/absolute/path/to/mypackage-0.1.0.tgz’

Should I use Turtle? Am I missing something?

Command used to build:

eas build -p android --profile=development --local

eas.json

 {
  "cli": {
    "version": ">= 0.48.0"
  },
  "build": {
    "development": {
      "distribution": "internal",
      "android": {
        "gradleCommand": ":app:assembleDebug",
        "buildType": "apk"
      },
      "ios": {
        "buildConfiguration": "Debug"
      }
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

Solution

  • After a lot of combinations:

    1. do not use Windows

    2. use Unix with Android Studio

      $ cd android && chmod +x ./gradlew
      $ ./gradlew assembleRelease

    Also, check this out:

    https://instamobile.io/android-development/generate-react-native-release-build-android/

    EDIT cause people dislike this answer:

    The fact is that after you eject the project, you can manage your app as if it is a native app. If you want to build with a custom package, not published, in local this seems to be the fastest and reliable way.