gpt4 book ai didi

javascript - 在 MainActivity.java React-native Android 中找不到符号

转载 作者:搜寻专家 更新时间:2023-11-01 09:31:48 25 4
gpt4 key购买 nike

我正在我的 React Native 应用程序中添加图片上传。我通过 npm 安装得很好,也很好地链接了它们

react-native link react-native-image-picker
react-native link react-native-image-resizer
react-native link react-native-fs

现在每次我尝试运行项目时都会遇到这些错误

Task :app:compileDebugJavaWithJavac C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:6: error: package com.rnfs does not exist import com.rnfs.RNFSPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:7: error: package fr.bamlab.rnimageresizer does not exist import fr.bamlab.rnimageresizer.ImageResizerPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:8: error: package com.imagepicker does not exist import com.imagepicker.ImagePickerPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:30: error: cannot find symbol new RNFSPackage(), ^ symbol: class RNFSPackage C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:31: error: cannot find symbol new ImageResizerPackage(), ^ symbol: class ImageResizerPackage C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:32: error: cannot find symbol new ImagePickerPackage(), ^

symbol: class ImagePickerPackage

当我检查 MainApplication.javaMainActivity.java 时,我在那里有包行。任何人的帮助?我无法弄清楚为什么会发生这种情况以及解决方案

最佳答案

将以下行添加到 app/build.gradle 解决了我的问题,

dependencies {
compile project(path: ':react-native-image-resizer')
compile project(path: ':react-native-fs')
compile project(path: ':react-native-image-picker')
}

关于javascript - 在 MainActivity.java React-native Android 中找不到符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46579627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com