方法或属性 expo-file-system.downloadAsync 在 Android 上不可用,您确定已正确链接所有本机依赖项吗?

Zîc*_*oan 7 react-native expo

我是反应本机的新手。我正在尝试添加博览会图标,当项目在设备上运行时,我收到此错误:

带有日志的屏幕截图

{
  "name": "TrackYourFitness",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "expo": "^36.0.2",
    "react": "16.9.0",
    "react-native": "0.61.5"
  },
  "devDependencies": {
    "@babel/core": "^7.8.3",
    "@babel/runtime": "^7.8.3",
    "@react-native-community/eslint-config": "^0.0.6",
    "babel-eslint": "^10.0.3",
    "babel-jest": "^25.1.0",
    "eslint": "^6.8.0",
    "eslint-plugin-flowtype": "^4.6.0",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.58.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}
Run Code Online (Sandbox Code Playgroud)

我尝试了纱线反应本机链接,但它不起作用。

我该如何修复它?提前致谢!

MBa*_*ach 1

根据您的错误消息,您正在尝试调用downloadAsync包中的方法expo-file-system

您的package.json.

要安装它:运行以下命令:

expo install expo-file-system
Run Code Online (Sandbox Code Playgroud)

但我认为这与您的问题无关,因为您正在谈论图标。Icons 包已经包含在 Expo 中,所以它可以工作。

供参考: https: //docs.expo.io/versions/latest/guides/icons/