【问题标题】:React Native / EXPO / iOS Simulator Stuck @ 'Downloading Javascript Bundle 100%'React Native / EXPO / iOS Simulator Stuck @ 'Downloading Javascript Bundle 100%'
【发布时间】:2019-02-02 07:10:09
【问题描述】:
一周前,我安装了一个新软件包,我的 iOS 模拟器运行良好,但突然停止加载。由于使用Material Icons 和Expo,我遇到了“字体系列”问题。我记得尝试在 Xcode 上打开项目,但发现了一个不需要 Xcode 的不同解决方案。我想也许在 Xcode 中打开项目可能会有所作为?
以下是我尝试解决此问题的方法:
- 删除 iOS sim 选项中的“内容和设置”。
- 结帐给大师,从几周前结帐给大师
- 还原所有更改并卸载软件包
- 处理
CreateChannelAndroidAsync黄色错误(这是唯一弹出但无关的错误)
- 清除所有东西:watchman watch-del-all && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
- 删除并重新安装 XCode
- 分支在我同事的 Mac 上运行良好。
- 未尝试:创建新项目。这就是我接下来要做的。
关于从这里去哪里有什么建议吗?
【问题讨论】:
标签:
xcode
react-native
ios-simulator
【解决方案1】:
在我的 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,现在它可以工作了!
这与定位服务有关。