简体   繁体   English

无法在“/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/jarsigner”中找到可执行文件

[英]Unable to locate an executable at "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/jarsigner"

I'm trying to build a release bundle on android and for some reason, it started to give me this error:我正在尝试在 android 上构建一个发布包,由于某种原因,它开始给我这个错误:

Command:命令:

flutter build appbundle --target-platform android-arm,android-arm64 --build-number=$VERSION_CODE --build-name=$VERSION_NAME

Error:错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageReleaseBundle'.
> java.util.concurrent.ExecutionException: java.lang.RuntimeException: jarsignerfailed with exit code 2 :
  Unable to locate an executable at "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/jarsigner" (-1)

* 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 1m 0s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done                        61.8s
Gradle task bundleRelease failed with exit code 1

I've checked, the jarsigner binary is not on that directory.我检查过,jarsigner 二进制文件不在该目录中。 Tried to see if is somewhere installed with: whereas jarsigner and is located in /usr/bin/jarsigner试图查看是否在某个地方安装了: whereas jarsigner并且位于/usr/bin/jarsigner

I tried to copy/symlink the file in the directory Android Studio expects it to be but once I do that and execute the build command again the bundleRelease task of Gradle remains at Running Gradle task 'bundleRelease'... (This is taking an unexpectedly long time.) and doesn't finish.我试图复制/符号链接目录 Android Studio 中的文件,但是一旦我这样做并再次执行构建命令,Gradle 的bundleRelease任务仍然在Running Gradle task 'bundleRelease'... (This is taking an unexpectedly long time.)并且没有完成。

I can build APK for Release without a problem.我可以毫无问题地构建用于发布的 APK。

Flutter Doctor output: Flutter 博士 output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en-AL)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.2)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart-specific functionality.
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

Java version outputs: Java 版本输出:

openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

I have always built an app like this, for more than a year.一年多来,我一直在构建这样的应用程序。

Thanks in advance for the help.在此先感谢您的帮助。

If you are using android studio, change the JDK Location used by Gradle from embedded to OpenJDK (the one you have installed manually)如果您使用的是 android studio,请将 Gradle 使用的 JDK Location 从嵌入式更改为 OpenJDK(您手动安装的那个)

在此处输入图像描述

Do a clean build then.然后做一个干净的构建。 Or create a new project and copy-paste old code.或者创建一个新项目并复制粘贴旧代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 进程'command'/ Applications / Android Studio 3.0.1.app/Contents/jre/jdk/Contents/Home/bin/java''完成,退出值非零 - Process 'command '/Applications/Android Studio 3.0.1.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1 无法在“/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/apt”(-1)中找到可执行文件 - Unable to locate an executable at “/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/apt” (-1) 无法在“/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/policytool”中找到可执行文件 (-1) - Unable to locate an executable at "/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/policytool" (-1) 运行 sudo 时无法在“/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home/bin/apt”(-1) 找到可执行文件 - Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home/bin/apt" (-1) when running sudo 无法使用可执行文件/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java确定Java版本 - Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java 错误:任务':app:dexDebug'的执行失败。 > ProcessException:或'VirtualMachines / jdk1.8.0_31.jdk / Contents / Home / bin / java' - Error:Execution failed for task ':app:dexDebug'. > ProcessException: or 'VirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java' jdk1.8.0_152.jdk / Contents / Home / bin / java''完成,返回值非零255 - jdk1.8.0_152.jdk/Contents/Home/bin/java'' finished with non-zero exit value 255 无法通过 ant 命令 JAVA_HOME 定位 tools.jar 并且为 jdk 设置了 PATH 而不是 jre - Unable to locate tools.jar by ant command JAVA_HOME and PATH is set for jdk instead jre 无法找到jre1.8.0_77的可执行文件 - Unable to locate executable for jre1.8.0_77 Android Studio 中的默认 JDK 是 JRE - Default JDK in Android Studio is JRE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM