【问题标题】:Unable to create bundle in flutter无法在颤振中创建捆绑包
【发布时间】:2021-12-13 17:49:19
【问题描述】:

我正在使用 Gradle 构建一个颤振项目。我跑的时候

flutter build appbundle

我得到了如下所示的错误

 FAILURE: Build failed with an exception.                              
 
                                                                         
 * What went wrong:                                                       Execution failed for task ':image_gallery_saver:compileReleaseKotlin'.
 
 > Kotlin could not find the required JDK tools in the Java installation '/Library/Internet
 Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' used by Gradle. Make
 sure Gradle is running on a JDK, not JRE.
                                                                         
 * 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 24s                                                   
 Running Gradle task 'bundleRelease'...                                
 Running Gradle task 'bundleRelease'... Done                       
 25.7s Gradle task bundleRelease failed with exit code 1

请帮助我解决这个问题。

提前致谢!

【问题讨论】:

    标签: android flutter gradle flutter-dependencies


    【解决方案1】:

    确保 Gradle 在 JDK 而不是 JRE 上运行

    您在 JRE 而不是 JDK 上运行 gradle,安装 JDK 16 或更低版本(尚不支持 17),将其 bin 目录附加到 PATH 变量并删除 JRE 之一。

    【讨论】:

    • 感谢您的回复,您能否指导检查JDK或JRE版本并进行相同的配置?
    • 您不应使用 JRE。下载 JDK 16.0.1(如果您使用的是 Windows)here
    猜你喜欢
    • 1970-01-01
    • 2019-03-11
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 1970-01-01
    • 2019-03-07
    相关资源
    最近更新 更多