简体   繁体   English

对于苹果 M1 上的 build.gradle 中的输入字符串:“”

[英]for input string:"" in build.gradle on apple M1

When I run my app use jdk_x86(jdk1.8.0_321.jdk), I can build success, but when I use jdk_arm(zulu-8.jdk), gradle sync error:当我使用 jdk_x86(jdk1.8.0_321.jdk) 运行我的应用程序时,我可以构建成功,但是当我使用 jdk_arm(zulu-8.jdk) 时,gradle 同步错误:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/test/Work/Test/AlbumList/library/build.gradle' line: 29

* What went wrong:
A problem occurred evaluating project ':library'.
> For input string: ""

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

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

BUILD FAILED in 0s

the build gradle:构建等级:

29:def revisionNumber = 'git rev-list HEAD --count'.execute().getText().trim().toInteger()

I find 'git rev-list HEAD --count' run in a error path, not run in current project path.我发现 'git rev-list HEAD --count' 在错误路径中运行,而不是在当前项目路径中运行。

Check if you have gradle wrapper version 7.0+检查您是否有 gradle 包装器版本 7.0+

I lost quite some time testing several M1 JDK distros and all presented the same behavior.我花了很多时间测试几个 M1 JDK 发行版,并且都表现出相同的行为。

Turns out Gradle only added support to M1 on this version thus the error you're seeing结果 Gradle 仅在此版本上添加了对 M1 的支持,因此您看到的错误

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM