0

I have recently migrated from classic build to EAS (well, it was steep learning curve but worth it). Anyhow, now the build for iOS simulator works. Also, a production build works fine in TestFlight. However, even though developer profile build is successfully, it's only briefly showing the splash screen and goes to an error screen immediately on both iOS and Android

.

I am using a managed workflow (custom development client) and eas-cli/3.6.1 darwin-x64 node-v19.6.1, expo version 47.

iOS error: Expected MIME-Type to be 'application/javascript' or 'text/javascript', but got 'text/html'.

Android error Unable to load script. Make sure you're either running Metro or that your bundle 'index.android.bundle' is packaged correctly for release

eas.json file:

{
  "cli": {
    "version": ">= 3.6.1"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "channel": "development",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "simulator": {
      "distribution": "internal",
      "channel": "simulator",
      "ios": {
        "simulator": true,
        "resourceClass": "m1-medium"
      }
    },
    "production": {
      "channel": "production",
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

I have not been able to find anything related to this error despite searching. Does anyone have a lead how to resolve this?

Many thanks!!

Behnam Kamrani
  • 739
  • 7
  • 15

2 Answers2

0

I was told by @keith from Expo team what a silly thing I was wrong. So I used the link from a EAS development build--instead of a link generated from a live server npx expo start --dev-client. So that development build is supposed to be installed as standalone similarly to production build.

Example of a development build which is a pointer to download the build (do not try to load it in Expo dev-client) https://expo.dev/register-device/46a...

Example of a link generated from a npx expo start --dev-client: exp+onruncurrent://expo-development-client/?url=http%3A%2F%2F10.203.60.138%3A8081

Behnam Kamrani
  • 739
  • 7
  • 15
0

You can try these steps to fix issues and build .aab and .apk for both release and debug mode.

step 1- check if any issue exists with dependencies:

1-expo doctor --fix-dependencies
2-expo doctor

Note: If you find any issue with the above command then you have to fix it by installing those dependencies manually. Otherwise, you can follow the below steps.

Now run these commands to generate .apk and .aab

1- npm install -g eas-cli
2- eas login (optional)
3- eas build:configure
4- eas build --platform android

Now your file is ready. Thankyou.