运行Flutter项目一直运行良好,直到在dart包java文件ImagePickerPlugin.java中添加对ImageIO的调用。导入位于顶部,命令单击显示IDE中的类,但编译失败。
try {
Image image = ImageIO.read(sourceimage);
} catch (IOException e) {
e.printStackTrace();
}
Comile错误:
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
/Users/marchampson/.pub-cache/hosted/pub.dartlang.org/image_picker0.3.0/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerPlugin.java:27: error: package javax.imageio does not exist
import javax.imageio.ImageIO;
使用IntelliJ IDEA更改飞镖包时有任何问题吗? 感谢
答案 0 :(得分:1)
导致这不是导入的问题,更多的是在Android上无法使用ImageIO。通过以下方式找到了这个:
Library Java can't resolve in Android Studio 3.1
已经走了另一条路,现在都在工作。