【问题标题】:I can't test my app in iOS with Expo我无法使用 Expo 在 iOS 中测试我的应用程序
【发布时间】:2018-04-04 06:27:40
【问题描述】:

当我尝试在装有 iOS 的手机上运行我的应用程序时遇到了一些问题,但在 Android 中没有这个问题。我在 Sublime Text 中编码,而不是在 XDE 中并在终端中执行我的项目,使用命令 npm start 并读取 QR 码。我在 Windows 10 中编码。 我用create-react-native-app构建项目

出现的错误是

C:/Users/adria/Desktop/App/src/Imgs/image.png:找不到模块 'C:/Users/adria/Desktop/App/node_moduless/expo/tools/hashAssetFiles'

第一次我确实认为图像的名称或目录错误,我去代码并证明这是正确的。所以,我决定在我的 Android 中尝试一下,令我惊讶的是,它可以正常工作。`

我的项目: [https://snack.expo.io/HyKP1hyjz][1]

我的 package.json

{ 
  "name": "App", 
  "version": "0.1.0",
  "private": true,
  "devDependencies": { 
    "react-native-scripts": "1.11.1",  
    "jest-expo": "25.0.0", 
    "react-test-renderer": "16.2.0" 
  }, 
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": { 
  "start": "react-native-scripts start", 
  "eject": "react-native-scripts eject", 
  "android": "react-native-scripts android",
  "ios": "react-native-scripts ios", 
  "test": "node node_modules/jest/bin/jest.js" }, 
  "jest": { 
    "preset": "jest-expo" 
  },
  "dependencies": { 
    "expo": "^25.0.0", 
    "react": "16.2.0",
    "react-native": "0.52.0", 
    "react-navigation": "^1.5.8"
  } 
}

我尝试从我的项目中删除图像并再次尝试运行,但遇到了同样的问题,但来自 react-navigation 的另一个图像

C:\Users\adria\Desktop\App\node_modules\react-navigation\src\views\assets\back-icon.png

【问题讨论】:

  • 重启打包器也修复它

标签: ios react-native expo


【解决方案1】:

您需要安装 exponent 软件包,请参阅:https://github.com/expo/expo/issues/72

【讨论】:

    猜你喜欢
    • 2019-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-06
    • 2019-01-11
    相关资源
    最近更新 更多