一周前,我安装了一个新包,我的 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/