EAS 更新失败,在构建爱马仕 iOS 字节码时出现"invalid mapping"



我有一个托管的expo-react本机应用程序,它需要一个expo开发客户端。我刚刚添加了@react-navigation/material-top-tabs的包,包括以下内容:@react-navigation/material-top-tabsreact-native-tab-viewreact-native-pager-view

但是,在安装了这些包并包含了选项卡的代码后,eas update --auto构建失败,并出现以下错误:

npx eas update --auto                            
[expo-cli] --non-interactive is not supported, use $CI=1 instead
[expo-cli] Starting Metro Bundler
[expo-cli]
[expo-cli] iOS Bundling complete 10413ms
[expo-cli] Android Bundling complete 10411ms
[expo-cli] iOS Building Hermes bytecode for the bundle
[expo-cli]
[expo-cli] Error: Invalid mapping: {"generated":{"line":1,"column":180},"source":"my-app\node_modules\metro-runtime\src\polyfills\require.js","original":{"line":0,"column":0},"name":null}
[expo-cli] Error: Invalid mapping: {"generated":{"line":1,"column":180},"source":"my-app\node_modules\metro-runtime\src\polyfills\require.js","original":{"line":0,"column":0},"name":null}
[expo-cli]     at SourceMapGenerator_validateMapping [as _validateMapping] (my-appnode_modulesmetro-source-mapnode_modulessource-maplibsource-map-generator.js:289:13)
[expo-cli]     at SourceMapGenerator_addMapping [as addMapping] (my-appnode_modulesmetro-source-mapnode_modulessource-maplibsource-map-generator.js:101:12)
[expo-cli]     at my-appnode_modulesmetro-source-mapsrccomposeSourceMaps.js:42:15
[expo-cli]     at MappingsConsumer.eachMapping (my-appnode_modulesmetro-source-mapsrcConsumerAbstractConsumer.js:37:16)
[expo-cli]     at composeSourceMaps (my-appnode_modulesmetro-source-mapsrccomposeSourceMaps.js:36:16)
[expo-cli]     at createHermesSourcemapAsync (my-appnode_modules@expodev-serverbuildHermesBundler.js:156:25)
[expo-cli]     at async Promise.all (index 1)
[expo-cli]     at async Object.buildHermesBundleAsync (my-appnode_modules@expodev-serverbuildHermesBundler.js:142:30)
[expo-cli]     at async maybeAddHermesBundleAsync (my-appnode_modules@expoclibuildsrcexportfork-bundleAsync.js:130:40)
[expo-cli]     at async Object.bundleAsync (my-appnode_modules@expoclibuildsrcexportfork-bundleAsync.js:143:32)
[expo-cli]     at async Object.createBundlesAsync (my-appnode_modules@expoclibuildsrcexportcreateBundles.js:35:21)
[expo-cli]     at async Object.exportAppAsync (my-appnode_modules@expoclibuildsrcexportexportApp.js:56:21)
[expo-cli]     at async exportAsync (my-appnode_modules@expoclibuildsrcexportexportAsync.js:44:5)

package.json

{
"name": "my-app",
"version": "0.0.1",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo start --android --dev-client",
"ios": "expo start --ios --dev-client",
"web": "expo start --web",
"build:detox": "detox build -c ios.sim.expo",
"test:detox": "./bin/downloadExpoApp.sh && detox test --configuration ios.sim.expo",
"ci:test:detox": "detox test -c ios.sim.release -l verbose --cleanup",
"ci:build:detox": "detox build -c ios.sim.release",
"compile": "tsc --noEmit -p . --pretty",
"format": "prettier --write "app/**/*.{js,jsx,json,md,ts,tsx}"",
"lint": "eslint index.js App.js app test --fix --ext .js,.ts,.tsx && npm run format",
"patch": "patch-package",
"test": "jest",
"test:watch": "jest --watch",
"adb": "adb reverse tcp:9090 tcp:9090 && adb reverse tcp:3000 tcp:3000 && adb reverse tcp:9001 tcp:9001 && adb reverse tcp:8081 tcp:8081",
"postinstall": "node ./bin/postInstall",
"bundle:ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios",
"bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
"release:ios": "echo 'Not implemented yet: release:ios. Use Xcode. More info: https://reactnative.dev/docs/next/publishing-to-app-store'",
"release:android": "cd android && rm -rf app/src/main/res/drawable-* && ./gradlew assembleRelease && cd - && echo 'APK generated in ./android/app/build/outputs/apk/release/app-release.apk'",
"clean": "npx react-native-clean-project",
"clean-all": "npx react-native clean-project-auto"
},
"dependencies": {
"@eva-design/eva": "^2.1.1",
"@expo-google-fonts/space-grotesk": "^0.2.2",
"@expo/webpack-config": "^0.17.0",
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-firebase/analytics": "^15.7.0",
"@react-native-firebase/app": "^15.7.0",
"@react-native-firebase/auth": "^15.7.0",
"@react-native-firebase/crashlytics": "^15.7.0",
"@react-native-firebase/firestore": "^15.7.0",
"@react-native-firebase/perf": "^15.7.0",
"@react-navigation/bottom-tabs": "^6.3.2",
"@react-navigation/material-top-tabs": "^6.2.4",
"@react-navigation/native": "~6.0.1",
"@react-navigation/native-stack": "^6.0.2",
"@react-navigation/stack": "~6.3.1",
"@ui-kitten/components": "^5.1.2",
"@ui-kitten/eva-icons": "^5.1.2",
"apisauce": "2.1.5",
"date-fns": "^2.29.2",
"dotenv": "^16.0.3",
"expo": "~46.0.3",
"expo-application": "~4.2.2",
"expo-build-properties": "~0.3.0",
"expo-constants": "~13.2.4",
"expo-dev-client": "^1.3.0",
"expo-device": "~4.3.0",
"expo-file-system": "~14.1.0",
"expo-font": "~10.2.0",
"expo-linear-gradient": "~11.4.0",
"expo-localization": "13.1.0",
"expo-modules-core": "~0.11.6",
"expo-splash-screen": "~0.16.1",
"expo-status-bar": "~1.4.0",
"expo-updates": "~0.14.6",
"i18n-js": "3.9.2",
"mobx": "6.6.2",
"mobx-react-lite": "3.4.0",
"mobx-state-tree": "5.1.5",
"react": "18.0.0",
"react-native": "0.69.6",
"react-native-bootsplash": "4.3.2",
"react-native-gesture-handler": "~2.7.0",
"react-native-pager-view": "5.4.24",
"react-native-reanimated": "~2.10.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.18.0",
"react-native-svg": "^13.2.0",
"react-native-tab-view": "^3.2.1",
"react-native-web": "^0.18.7",
"reactotron-mst": "3.1.4",
"reactotron-react-js": "^3.3.7",
"reactotron-react-native": "5.0.3"
},
"devDependencies": {
"@babel/core": "^7.18.0",
"@babel/plugin-proposal-decorators": "7.19.3",
"@babel/plugin-proposal-optional-catch-binding": "7.18.6",
"@babel/preset-env": "^7.16.11",
"@babel/runtime": "^7.18.3",
"@react-native-community/cli-platform-ios": "^9.1.2",
"@rnx-kit/metro-config": "^1.2.32",
"@rnx-kit/metro-resolver-symlinks": "0.1.21",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.6",
"@semantic-release/release-notes-generator": "^10.0.3",
"@types/i18n-js": "3.8.2",
"@types/jest": "26.0.19",
"@types/react": "^17",
"@types/react-native": "0.67.8",
"@typescript-eslint/eslint-plugin": "5.39.0",
"@typescript-eslint/parser": "5.39.0",
"babel-jest": "26.6.3",
"babel-loader": "8.2.5",
"detox": "19.12.1",
"detox-expo-helpers": "0.6.0",
"eslint": "8.17.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.0.1",
"eslint-plugin-react": "7.31.8",
"eslint-plugin-react-native": "4.0.0",
"expo-detox-hook": "1.0.10",
"expo-modules-autolinking": "0.10.3",
"fbjs-scripts": "3.0.1",
"jest": "26",
"jest-circus": "29",
"jest-environment-node": "29",
"jest-expo": "^46.0.1",
"metro-config": "0.73.0",
"metro-react-native-babel-preset": "0.73.0",
"metro-source-map": "0.73.0",
"mocha": "6",
"patch-package": "6.4.7",
"postinstall-prepare": "2.0.0",
"prettier": "2.6.2",
"query-string": "^7.0.1",
"react-devtools-core": "4.26.0",
"react-dom": "18.0.0",
"reactotron-core-client": "^2.8.10",
"regenerator-runtime": "^0.13.4",
"semantic-release": "^19.0.5",
"semantic-release-expo": "^2.2.3",
"sharp-cli": "^3.0.0",
"ts-jest": "26",
"typescript": "4.8.4",
"webpack": "5",
"webpack-dev-server": "^4.11.1"
},
"resolutions": {
"@types/react": "^17",
"@types/react-dom": "^17"
},
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "all"
},
"detox": {
"test-runner": "jest",
"runnerConfig": "./detox/config.json",
"specs": "detox",
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/MyApp.app",
"build": "xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 14'",
"type": "ios.simulator",
"device": {
"name": "iPhone 14",
"os": "iOS 15.5"
}
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/MyApp.app",
"build": "xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -destination 'name=iPhone 14'",
"type": "ios.simulator",
"device": {
"name": "iPhone 14",
"os": "iOS 15.5"
}
},
"ios.sim.expo": {
"binaryPath": "bin/Exponent.app",
"type": "ios.simulator",
"name": "iPhone 14"
}
}
},
"eslintConfig": {
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-native/all",
"standard",
"prettier"
],
"plugins": [
"@typescript-eslint",
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"globals": {
"__DEV__": false,
"jasmine": false,
"beforeAll": false,
"afterAll": false,
"beforeEach": false,
"afterEach": false,
"test": false,
"expect": false,
"describe": false,
"jest": false,
"it": false
},
"rules": {
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/indent": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-object-literal-type-assertion": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"comma-dangle": 0,
"multiline-ternary": 0,
"no-undef": 0,
"no-unused-vars": 0,
"no-use-before-define": 0,
"no-global-assign": 0,
"quotes": 0,
"react-native/no-raw-text": 0,
"react/no-unescaped-entities": 0,
"react/prop-types": 0,
"space-before-function-paren": 0
}
}
}

eas.json

{
"cli": {
"version": ">= 1.1.1"
},
"build": {
"main": {
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"env": {
"APP_VARIANT": "development"
}
},
"preview": {
"distribution": "internal",
"env": {
"APP_VARIANT": "preview"
}
},
"production": {
"env": {
"APP_VARIANT": "production"
}
}
},
"submit": {
"production": {}
}
}

app.json

{
"expo": {
"name": "MyApp",
"slug": "my-app",
"owner": "silthus",
"version": "1.0.0-dev.16",
"runtimeVersion": "1.1.0",
"orientation": "portrait",
"icon": "./assets/images/app-icon-all.png",
"splash": {
"image": "./assets/images/splash-logo-all.png",
"resizeMode": "contain",
"backgroundColor": "#191015"
},
"plugins": [
"@react-native-firebase/app",
"@react-native-firebase/perf",
"@react-native-firebase/crashlytics",
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static"
}
}
]
],
"updates": {
"fallbackToCacheTimeout": 0,
"url": "https://u.expo.dev/00000000-0000-0000-0000-000000000000"
},
"jsEngine": "hermes",
"assetBundlePatterns": [
"**/*"
],
"android": {
"icon": "./assets/images/app-icon-android-legacy.png",
"googleServicesFile": "google-services.json",
"adaptiveIcon": {
"foregroundImage": "./assets/images/app-icon-android-adaptive-foreground.png",
"backgroundImage": "./assets/images/app-icon-android-adaptive-background.png"
},
"splash": {
"image": "./assets/images/splash-logo-android-universal.png",
"resizeMode": "contain",
"backgroundColor": "#191015"
},
"versionCode": 16
},
"ios": {
"icon": "./assets/images/app-icon-ios.png",
"supportsTablet": true,
"googleServicesFile": "./GoogleService-Info.plist",
"splash": {
"image": "./assets/images/splash-logo-ios-mobile.png",
"tabletImage": "./assets/images/splash-logo-ios-tablet.png",
"resizeMode": "contain",
"backgroundColor": "#191015"
},
"buildNumber": "1.0.0"
},
"web": {
"favicon": "./assets/images/app-icon-web-favicon.png",
"splash": {
"image": "./assets/images/splash-logo-web.png",
"resizeMode": "contain",
"backgroundColor": "#191015"
},
"build": {
"babel": {
"include": [
"@ui-kitten/components"
]
}
}
}
}
}

app.config.ts

import 'dotenv/config';
import { ConfigContext } from '@expo/config';
let name = 'Climbers Atlas'
let packageName = 'com.myapp.app'
switch (process.env.APP_VARIANT) {
case 'production':
break
case 'preview':
name += ' (Preview)'
packageName += '.preview'
break
default:
case 'development':
name += ' (DEV)'
packageName += ".dev"
break
}
export default ({ config }: ConfigContext) => ({
...config,
name: name,
ios: {
...config.ios,
bundleIdentifier: packageName
},
android: {
...config.android,
package: packageName
},
web: {
...config.web,
config: {
firebase: {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID
}
}
},
extra: {
eas: {
projectId: "00000000-0000-0000-0000-000000000000",
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID
}
}
});

好的,所以我发现了问题:从0.71.10.73.0metro-source-map更新似乎破坏了更新运行。

将以下库降级为0.71.1eas update应该可以工作。

"devDependencies": {
"metro-config": "0.71.1",
"metro-react-native-babel-preset": "0.71.1",
"metro-source-map": "0.71.1"
}

最新更新