Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"main.jsbundle does not exist" error when building iOS version with Expo SDK 48 #21542

Closed
aliy321 opened this issue Mar 5, 2023 · 11 comments
Closed
Labels
Development Builds needs review Issue is ready to be reviewed by a maintainer

Comments

@aliy321
Copy link

aliy321 commented Mar 5, 2023

Summary

Upgraded my app to expo 48 and when i try to eas build -p ios --auto-submit, fastlane return error stating,

❌ error: File /Users/expo/Library/Developer/Xcode/DerivedData/myhadeeth-hiaplixirxjnvmeiueeslgnqimmw/Build/Intermediates.noindex/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/XXXX.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues

Managed or bare workflow?

managed

What platform(s) does this occur on?

iOS

Package versions

{
"name": "xxxx",
"version": "1.0.0",
"private": true,
"scripts": {
"android": "expo start --android",
"build:android": "eas build -p android",
"build:ios": "eas build -p ios",
"ios": "expo start --ios",
"main": "index.js",
"start": "expo start",
"web": "expo start --web"
},
"resolutions": {
"metro": "^0.73.7",
"metro-resolver": "^0.73.7"
},
"dependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/runtime": "^7.21.0",
"@freakycoder/react-native-helpers": ">= 0.0.21",
"@react-native-async-storage/async-storage": "^1.17.11",
"@supabase/supabase-js": "^2.8.0",
"dotenv": "^16.0.3",
"expo": "^48.0.5",
"expo-av": "~13.2.1",
"expo-constants": "~14.2.1",
"expo-haptics": "~12.2.1",
"expo-linking": "~4.0.1",
"expo-location": "~15.1.1",
"expo-router": "^1.2.0",
"expo-sensors": "~12.1.1",
"expo-splash-screen": "~0.18.1",
"expo-status-bar": "~1.4.4",
"nativewind": "^2.0.11",
"postcss": "^8.4.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "^4.7.1",
"react-native": "0.71.3",
"react-native-easy-grid": "^0.2.2",
"react-native-gesture-handler": "^2.9.0",
"react-native-reanimated": "~2.14.4",
"react-native-root-toast": "^3.4.1",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-svg": "13.4.0",
"react-native-url-polyfill": "^1.3.0",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-root-import": "^6.6.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"react-native-dotenv": "^3.4.8",
"tailwindcss": "^3.2.7"
},
"overrides": {
"metro": "^0.73.7",
"metro-resolver": "^0.73.7"
}
}

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.6
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.19.2 - /usr/local/bin/npm
Managers:
CocoaPods: 1.12.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
npmPackages:
expo: ^48.0.5 => 48.0.5
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.71.3 => 0.71.3
react-native-web: ~0.18.7 => 0.18.12
npmGlobalPackages:
eas-cli: 3.7.2
expo-cli: 6.3.2
Expo Workflow: managed

Reproducible demo

Not sure if babel is the issue but here's my babel.

module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
"nativewind/babel",
'transform-inline-environment-variables', ["module:react-native-dotenv"],
"@babel/plugin-proposal-export-namespace-from",
"react-native-reanimated/plugin",
require.resolve("expo-router/babel"),
["module-resolver",
{
root: ["./app"],
alias: {
"@components": "./app/components",
"@pages": "./app/pages",
"@assets": "./assets",
"@context": "./app/context",
"@lib": "./lib",
},
}]
],
};
};

my app.json

{
"expo": {
"scheme": "xxx",
"name": "xxx",
"slug": "xxx",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.anonymous.my-hadeeth",
"infoPlist": {
"NSLocationAlwaysAndWhenInUseUsageDescription": "App requires geolocation to improve the quality of the service",
"NSLocationAlwaysUsageDescription": "App requires geolocation to improve the quality of the service",
"NSLocationWhenInUseUsageDescription": "App requires geolocation to improve the quality of the service",
"UIBackgroundModes": [
"remote-notification",
"audio",
"fetch",
"location"
]
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"package": "com.anonymous.myhadeethNew"
},
"web": {
"favicon": "./assets/favicon.png",
"bundler": "metro"
},
"extra": {
"eas": {
"projectId": "c62a81be-a4d6-4ed1-9ff9-eb725babc6e7"
}
}
}
}

Stacktrace (if a crash is involved)

none

@aliy321 aliy321 added Development Builds needs validation Issue needs to be validated labels Mar 5, 2023
@aliy321 aliy321 changed the title "main.jsbundle does not exist" error when building iOS version locally with Expo SDK 47 "main.jsbundle does not exist" error when building iOS version locally with Expo SDK 48 Mar 5, 2023
@expo-bot expo-bot added the needs review Issue is ready to be reviewed by a maintainer label Mar 5, 2023
@aliy321 aliy321 changed the title "main.jsbundle does not exist" error when building iOS version locally with Expo SDK 48 "main.jsbundle does not exist" error when building iOS version with Expo SDK 48 Mar 5, 2023
@aliy321
Copy link
Author

aliy321 commented Mar 5, 2023

Here's my xcode log:
xcode-build-9d3e92ac-efcd-41e4-9a5d-6625ef159154.log

@gabrieldonadel gabrieldonadel removed the needs validation Issue needs to be validated label Mar 7, 2023
@maurorusso22
Copy link

same problem here

@IgorHalfeld
Copy link

IgorHalfeld commented Mar 17, 2023

same problem here, I saw #20428 and #20129 and I still facing this error

sdk: 47
eas: 3.8.1

@aliy321 aliy321 closed this as completed Mar 24, 2023
@liho00
Copy link

liho00 commented Mar 29, 2023

@aliy321 have you found the solution? could you share to us?

@aliy321
Copy link
Author

aliy321 commented Mar 29, 2023

@aliy321 have you found the solution? could you share to us?

I create a new app and slowly port 1 by 1 over to find the issue, not sure what causes it too but after porting 1by1 and having the same code it work HAHAHA

@cspeer
Copy link

cspeer commented Apr 5, 2023

Hiya,

I still had this issue with SDK 48.x and nothing worked, but after about 24h I stumpled upon this comment on StackOverflow: https://stackoverflow.com/questions/74141628/how-do-i-debug-this-error-error-error-resolvedependencies-found-duplicate-d

This is what worked:

You shouldn’t have any metro* dependencies listed in your project’s package.json except, for non-Expo, metro-react-native-babel-preset. Metro is a transitive dependency in React Native / Expo apps, so you don't need to list it.

@akitoshi
Copy link

akitoshi commented Apr 5, 2023

@cspeer It works well. I spent a long time working on a fix and this was the right one. Thank you!

@booncoder123
Copy link

booncoder123 commented Jun 12, 2023

The problem are the version conflict on React-native and metro-config for my case.
you can check it by typing this command
npm ls metro
In my case, it show result as below code.
├─┬ metro-config@0.70.3
│ └─┬ metro@0.70.3
│ └─┬ metro-transform-worker@0.70.3
│ └── metro@0.70.3 deduped
└─┬ react-native@0.71.4 invalid: "0.71.8" from the root project
└─┬ @react-native-community/cli@10.2.0
└─┬ @react-native-community/cli-plugin-metro@10.2.2
├─┬ metro-config@0.73.9
│ └── metro@0.73.9 deduped
└─┬ metro@0.73.9
└─┬ metro-transform-worker@0.73.9

    **Therefore,i continue using ChatGPT for making suggestion what should i do next, it suggest that i should update the conflict version.**
  1. Update react-native version: The output shows that your root project requires version 0.71.8 of react-native, but the installed version is 0.71.4. You can try updating the react-native package to the required version by running npm install react-native@0.71.8.
  2. Clear npm cache: Sometimes, the npm cache can cause issues with dependency resolution. You can try clearing the npm cache by running npm cache clean --force, and then reinstalling your dependencies by running npm install.
  3. Check for conflicting dependencies: It appears that the metro-config package has different versions (0.70.3 and 0.73.9) installed in different parts of your dependency tree. This can lead to conflicts. You may need to check your project's package.json and package-lock.json files to see if there are any conflicting dependencies. Ensure that all packages are using compatible versions of Metro.
  4. Remove node_modules and reinstall: If the above steps don't resolve the issue, you can try removing the node_modules directory and reinstalling all dependencies. To do this, run the following commands:
    rm -rf node_modules npm install

To upgrade metro-config version you can follow this suggestion.

  1. Remove the metro-config package from your project's dependencies section. It is not required to be explicitly listed since it is a transitive dependency of other packages.
  2. Update the react-native package to version 0.71.8. Currently, it is set to "react-native": "0.71.8", which matches the desired version mentioned in the output of npm ls metro. However, it seems that the installed version is 0.71.4. To update it, run npm install react-native@0.71.8.
  3. Update the metro package: The output shows that you have different versions of the metro package (0.70.3 and 0.73.9). To resolve this, you can update the metro package to its latest version by running npm install metro@latest

After follow this instruction everything work as magic!!

ref

@JayZhouzzj
Copy link

I had this error too. I was using expo router. Just need to do these steps https://docs.expo.dev/routing/installation/

Most importantly in package.json

{
  "main": "index.js"
}

if you're using SDK 48

@d0sc
Copy link

d0sc commented Sep 1, 2023

I have the same issue and nothing worked for me.
I rebuild my entire app with a fresh npx create-expo-app
reinstalled all packages and did everything I am capable of. Since this is my very first react-native project, I am out of my league here.

This is my package.json:
{
"name": "simplico-app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.19.3",
"@react-navigation/bottom-tabs": "^6.5.8",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"expo": "~49.0.8",
"expo-font": "~11.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-status-bar": "~1.6.0",
"firebase": "^10.3.1",
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-switch": "^1.5.1",
"react-native-vector-icons": "^10.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}

@nickopicz
Copy link

I have the same problem where the bundle is not found. However my xcode logs have no other errors.

package.json: {
"name": "socrio-mobile",
"version": "1.3.0",
"main": "index.js",
"scripts": {
"start": "npx expo start"
},
"dependencies": {
"@babel/preset-env": "7.1.6",
"@expo-google-fonts/inter": "^0.2.2",
"@expo-google-fonts/overpass": "^0.2.2",
"@expo/ngrok": "^4.1.0",
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-picker/picker": "2.4.8",
"@react-navigation/bottom-tabs": "^6.5.4",
"@react-navigation/drawer": "^6.6.0",
"@react-navigation/material-bottom-tabs": "^6.2.11",
"@react-navigation/native": "^6.1.4",
"@react-navigation/native-stack": "^6.9.0",
"@reduxjs/toolkit": "^1.9.0",
"esdoc": "^1.1.0",
"esdoc-ecmascript-proposal-plugin": "^1.0.0",
"esdoc-standard-plugin": "^1.0.0",
"expo": "47.0.6",
"expo-av": "~13.0.3",
"expo-blur": "~12.0.1",
"expo-branch": "^6.1.1",
"expo-build-properties": "~0.4.1",
"expo-checkbox": "~2.2.0",
"expo-device": "~5.0.0",
"expo-document-picker": "~11.0.1",
"expo-file-system": "~15.1.1",
"expo-firebase-recaptcha": "~2.3.0",
"expo-font": "~11.0.1",
"expo-haptics": "~12.0.1",
"expo-linear-gradient": "~12.0.1",
"expo-linking": "~3.3.1",
"expo-location": "~15.0.1",
"expo-media-library": "~15.0.0",
"expo-notifications": "~0.17.0",
"expo-sharing": "~11.0.1",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"expo-task-manager": "~11.0.1",
"expo-updates": "~0.15.6",
"expo-vector-icons": "^10.0.1",
"firebase": "8.7.0",
"lottie-ios": "3.4.0",
"lottie-react-native": "5.1.4",
"moment": "^2.29.4",
"prop-types": "^15.8.1",
"react": "18.1.0",
"react-native": "0.70.14",
"react-native-country-codes-picker": "^2.3.3",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.8.0",
"react-native-paper": "^5.1.4",
"react-native-picky": "^0.4.0",
"react-native-reanimated": "~2.12.0",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-text-ticker": "^1.14.0",
"react-native-vector-icons": "^9.2.0",
"react-native-webview": "11.23.1",
"react-redux": "^8.0.5",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "^18.0.25",
"madge": "^6.1.0",
"typescript": "^4.6.3"
},
"private": true
}

xCode logs:
xcode-build-b172eea3-219b-4ee1-b70c-bffea54337a7(1).log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development Builds needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests