简体   繁体   English

Expo React-Native:EAS iOS 构建失败

[英]Expo React-Native: EAS iOS build failing

I've been having issues building the iOS app with eas and the managed workflow.我在使用eas和托管工作流构建 iOS 应用程序时遇到问题。 The build fails during the fastlane build phase.fastlane构建阶段构建失败。

Strangely, the android version of the app builds successfully with eas , no problem.奇怪的是,android版本的app用eas构建成功,没问题。

The iOS version functions without issue in the simulator. iOS 版本在模拟器中正常运行。 Only the EAS build fails.只有 EAS 构建失败。

Fastlane error output快车道错误 output

❌  error: File /Users/expo/Library/Developer/Xcode/DerivedData/Lehgu-dvthmbotvulohlhkecuuafkapqgu/Build/Intermediates.noindex/ArchiveIntermediates/Lehgu/BuildProductsPath/Release-iphoneos/Lehgu.app/main.jsbundle does not exist. This must be a bug with


❌ Metro encountered an error:
Unable to resolve module ./src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/_07quizStressbewältigungUmgang.js from /Users/expo/workingdir/build/contentConfig.js:

None of these files exist:
  * src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/_07quizStressbewältigungUmgang.js(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.svg|.native.svg|.svg)
  * src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/_07quizStressbewältigungUmgang.js/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.svg|.native.svg|.svg)
  92 | import testbegegnen from "./src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/testbegegnen.js"
  93 | import _06stressbewaeltigungLehrkraftberuf from "./src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/_06stressbewaeltigungLehrkraftberuf.js"
> 94 | import { _07quizStressbewältigungUmgang } from "./src/content/03_UmgangMitStress/02_WasHilftMirBeimUmgangMitStress/_07quizStressbewältigungUmgang.js"
     |                                                 ^
  95 |
  96 | import _00wieGelingtEsMir from "./src/content/03_UmgangMitStress/03_WieGelingtEsMirZurRuheZuKommen/_00wieGelingtEsMir.js"
  97 | import _01achtsamkeitKurzErklaert from "./src/content/03_UmgangMitStress/03_WieGelingtEsMirZurRuheZuKommen/_01achtsamkeitKurzErklaert.js"
› Generating debug Lehgu » Lehgu.app.dSYM
⚠️  No such file or directory: /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/C/org.llvm.clang.distiller/ModuleCache/OEL3R4BB85DS/FBSDKLoginKit-ROJFAQUX0UXS.pcm
⚠️  No such file or directory: /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/C/org.llvm.clang.distiller/ModuleCache/OEL3R4BB85DS/UIKit-7ENARD7F75QG.pcm
⚠️  No such file or directory: /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/C/org.llvm.clang.distiller/ModuleCache/OEL3R4BB85DS/Foundation-3ESNQVWWD07IL.pcm
⚠️  No such file or directory: /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/C/org.llvm.clang.distiller/ModuleCache/OEL3R4BB85DS/SwiftShims-3E5PYOC7W29IN.pcm
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸   PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/Library/Developer/Xcode/DerivedData/Lehgu-dvthmbotvulohlhkecuuafkapqgu/Build/Intermediates.noindex/ArchiveIntermediates/Lehgu/IntermediateBuildFilesPath/Lehgu.build/Release-iphoneos/Lehgu.build/Script-00DD1BFF1BD5951E006B06BC.sh
▸ (1 failure)
** ARCHIVE FAILED **

Based on the output of fastlane, it seems that the files don't exist at the specified path, but they definitely do.根据fastlane的output,在指定的路径下似乎文件不存在,但肯定存在。 The app also runs just fine in the simulator and I can succesfully build using the old expo build tool (both iOS and Android) this seems to be something specific to fastlane or the EAS config that I don't understand.该应用程序在模拟器中也运行良好,我可以使用旧的 expo 构建工具(iOS 和 Android)成功构建,这似乎是我不理解的 fastlane 或 EAS 配置所特有的。

Anyone have any helpful pointers?有人有任何有用的指示吗?

I was expierencing the exact same problem.我遇到了完全相同的问题。 Build for iOS failed only with internal distribution, while Android build succeeded. iOS 的构建仅在内部分发时失败,而 Android 构建成功。

Finally I figured, that I had moved the App.(tsx|js) into a src folder but didn't complied to the requirements for doing so.最后我想,我已经将App.(tsx|js)移动到src文件夹中,但没有遵守这样做的要求。

So a quick fix could be moving the App.(tsx/js) back to the root and remove the entryPoint from your app.(json|config.js|config.ts) .因此,快速修复可能是将App.(tsx/js)移回根目录并从您的app.(json|config.js|config.ts)中删除entryPoint Your package.json should include this:您的package.json应包括:

"main": "node_modules/expo/AppEntry.js"

Otherwise the docs state for SDK 46 and lower you need to have a index.js in your project root and call registerRootComponent with you App component as parameter:否则, 文档state 用于 SDK 46 及更低版本,您需要在项目根目录中有一个index.js并使用您的App组件调用registerRootComponent作为参数:

import { registerRootComponent } from 'expo';
import App from './src/App';

registerRootComponent(App);

With this approach you have to remove the main key in your package.json .使用这种方法,您必须删除package.json中的main键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM