首页 > 解决方案 > 在颤振中使用 photo_manager 包的自定义媒体(图片和视频)不起作用

问题描述

我正在开发一个颤振应用程序,我想在其中构建一个自定义图库来显示我的图片和视频。我正在尝试使用 photo_manager 包来实现这一点,但是每当我将包添加到我的 pubspec.yaml 并运行我的应用程序时,我什至在不使用包的情况下都会收到以下错误。

e: java.io.IOException: Cannot run program "C:\Program Files\Android\Android Studio\jre\jre\bin\java" (in directory "C:\Users\Sylvester\AppData\Local\kotlin\daemon"): CreateProcess error=2, The system cannot find the file specified

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':photo_manager:compileDebugKotlin'.
> java.io.IOException: Cannot run program "C:\Program Files\Android\Android Studio\jre\jre\bin\java": CreateProcess error=2, The system cannot find the file specified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 57s
Exception: Gradle task assembleDebug failed with exit code 1

请任何帮助将不胜感激

标签: fluttercompiler-errorspackagephoto-gallery

解决方案


我运行了这些命令,它似乎修复了它

flutter clean
flutter pub upgrade
flutter pub get

推荐阅读