Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 1.2.1 在 macOS 13.6.7 上 apkSigner命令检查失败 #17

Open
machaogit opened this issue Jun 27, 2024 · 11 comments
Open

[BUG] 1.2.1 在 macOS 13.6.7 上 apkSigner命令检查失败 #17

machaogit opened this issue Jun 27, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@machaogit
Copy link

machaogit commented Jun 27, 2024

系统类型

macOS

系统版本

13.6.7

软件版本

1.2.1

问题描述

遇到的问题

image

一直提示报错,apksigner一直配置不了

复现步骤

@machaogit machaogit added the bug Something isn't working label Jun 27, 2024
@jixiaoyong
Copy link
Owner

请参考下图打开日志目录,打开你操作时间对应的日志,搜索“apk signer”查看命令执行和错误输出;或者也可以发上来一起分析。

image

@jixiaoyong jixiaoyong changed the title [BUG] 概述遇到的问题 [BUG] 1.2.1 在 macOS 13.6.7 上 apkSigner命令检查失败 Jun 27, 2024
@machaogit
Copy link
Author

machaogit commented Jun 27, 2024

2024-06-27 17:15:03.093 apk signer command: /Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner version
2024-06-27 17:15:08.221 apk signer command: /Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner version
这个是日志,我试了一下这个命令应该是可以正常执行的

@jixiaoyong
Copy link
Owner

jixiaoyong commented Jun 27, 2024 via email

@jixiaoyong
Copy link
Owner

2024-06-27 17:15:03.093 apk signer command: /Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner version 2024-06-27 17:15:08.221 apk signer command: /Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner version 这个是日志,我试了一下这个命令应该是可以正常执行的

可以正常执行,,,

那你是如何添加这个apksigner的呢,下面的两种方式都可以试一下
image

或者换一个版本的apksigner,比如33.0.0或35.x试试。或者把文件发过来我试一下。

@machaogit
Copy link
Author

machaogit commented Jun 27, 2024

image

这是1的报错,日志也是一样的》》apk signer command: /Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner version

image
本地执行version命令

@machaogit
Copy link
Author

zipalign是可以正常设置的

@jixiaoyong
Copy link
Owner

方式1的话有两个方法:

一个是直接拖动对应文件夹到该处【推荐】:

Recording at 2024-06-27 18 38 58

一个是点击然后选择build-tools目录,这种方式需要注意:

是在build-tools目录,点击选中需要的版本,如下图:
image

如果下面这样就会获取到错误的地址:
image

@machaogit
Copy link
Author

20240627194454_rec_
拖选操作没反应,点击操作报错

@jixiaoyong
Copy link
Owner

有空可以试一下这个包,https://github.com/jixiaoyong/ApkSigner/releases/tag/v1.2.1-20240628021321-alpha

在修改设置信息出错后,会输出更详细的错误信息,可以复制错误信息或查看日志,方便分析错误:

image

@machaogit
Copy link
Author

apkSigner命令(/Users/test/Library/Android/sdk/build-tools/34.0.0/apksigner)检查失败,请重试(apk signer: exit code: 1

err:The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.


没看懂这个错误,jdk环境变量应该是没问题的
image

@jixiaoyong
Copy link
Owner

jixiaoyong commented Jun 28, 2024

感觉有个人的情况和你比较类似
也是MacOS 13,使用homebrew安装jdk

来源:Java Runtime not found https://forums.developer.apple.com/forums/thread/687489?answerId=748385022#748385022

I had the same issue with macOS Ventura 13.0.1 - I installed homebrew and brew installed java by following this StackOverFlow: https://stackoverflow.com/questions/65601196/how-to-brew-install-java
I think the main part worked for me is this - "you also need to create a symlink for the system Java wrappers to find this JDK[解决方案看这里]:" sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

可以参考他提到的问题路径:
https://stackoverflow.com/questions/65601196/how-to-brew-install-java

此外,参考我查到的其他人说法,可能和JAVA_HOME是否正确,以及是否安装成了jre而非jdk等等,也可以参考一下。

不过还是有点奇怪,在你的终端可以运行,在app中用代码调用反而不行,是不是终端和系统的环境变量不用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants