簡體   English   中英

React Native - 無法在 iOS 中加載包

[英]React Native - Failed to load bundle in iOS

打開應用程序時出現錯誤屏幕

我是本地 iOS 應用程序開發人員,但我也想了解最新和趨勢技術,所以我選擇動手進行 React Native。 現在,我在嘗試在 iOS 上運行我的 React Native 創建的應用程序時遇到此錯誤。 我輸入命令 react-native run-ios 和模擬器啟動,並在該應用程序打開后但在啟動時顯示此屏幕。

下面的鏈接中提供了幾種解決方案。 請嘗試它們。

https://github.com/facebook/react-native/issues/21310

for now after react-native init, since a lot of new changes are coming out, this fix worked for me (I got it from reading other issues):
with npm:
npm install --save-dev @babel/core
npm install --save-dev @babel/runtime
or with yarn:
yarn add --dev @babel/core
yarn add --dev @babel/runtime

if on ios you get _this._registerEvents is not a function, after a successful build
do
npm run start --reset-cache
or
react-native start --reset-cache

對我來說,我現在有一些問題的原因,因為很多新的變化正在出現,比如 Xcode 10 本身是新的,而 react native 尚未與它合並,這個修復對我有用:

使用 npm:

npm install --save @babel/runtime

或用紗線:

紗線添加@babel/runtime

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM