xcode - React Native/EXPO/iOS 模拟器卡住 @ 'Downloading Javascript Bundle 100%'

标签 xcode react-native ios-simulator

一周前,我安装了一个新包,我的 iOS 模拟器工作正常,但突然停止加载。由于使用 Material Icons 和 Expo,我遇到了“字体系列”问题。我记得我曾尝试在 Xcode 上打开该项目,但发现了一个不需要 Xcode 的不同解决方案。我想也许在 Xcode 中打开项目可能做了一些事情?

以下是我尝试解决此问题的方法:

  • 清除 iOS SIM 卡选项中的“内容和设置”。
  • 结账给 Master,几周前结账给 master
  • 还原所有更改并卸载包
  • 处理 CreateChannelAndroidAsync 黄色错误(这是唯一弹出但无关的错误)
  • 清除所有内容:watchman watch-del-all && rm -rf node_modules/&& npm cache verify && npm install && npm start -- --reset-cache
  • 删除并重新安装 XCode
  • Branch 在我同事的 Mac 上运行良好。
  • 还没有尝试过:创建一个新项目。这就是我接下来要做的。

关于从这里去哪里有什么建议吗?

最佳答案

在我的 App.js 中,我的 loadAsyncs 函数运行如下:

async _loadAssetsAsyncIos() {

    let loadFonts = await Expo.Font.loadAsync({
      Lato: require("./static/fonts/Lato-Regular.ttf"),
      LatoBold: require("./static/fonts/Lato-Bold.ttf"),
      Arial: require("./static/fonts/arial.ttf"),
      'Material Icons': require('@expo/vector-icons/fonts/MaterialIcons.ttf')
    });

    let loadImages = await preloadImages.map(image => {
      Expo.Asset.fromModule(image).downloadAsync()
    })

    let location = await getDeviceLocation()

    Promise.all([ loadFonts, loadImages, location ]).then((resp) => {
      return
    })
  }

我注释掉了 let location 并在 Promise 中删除了 location 现在它可以正常工作了!

它与定位服务有关。

关于xcode - React Native/EXPO/iOS 模拟器卡住 @ 'Downloading Javascript Bundle 100%',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52044510/

相关文章:

ios - 无法附加到 pid : “16541” unable to attach ios simulator

react-native - 如何在react-native中获取文件的绝对路径?

Xamarin:Visual Studio Start iOS 应用程序总是终止(找到解决方法)

xcode - 我可以使用iOS模拟器为App Store制作屏幕截图吗?

iOS Facebook 快速登录

React-native-image-picker:如何以网格方式直接访问图库图像

javascript - 从 swift 或 objective-c 向 js 发送事件

ios - 如何获取 Facebook 用户的已验证状态

swift - Xcode Swift 3 ~ 让速度变成整数

ios - 无法将 xcassets 分配给 Xcode 11 上的主要目标