异常日志(全文):
Init SDKMan
Found Android manifest
Android SDK version: . Build tools:
Found gradle
Gradle build script
WARNING: gradle/wrapper/gradle-wrapper.jar does not exist! Needs to be committed.
ERROR: Gradle wrapper not found. Please add. Using default gradle to build.
grep: gradle/wrapper/gradle-wrapper.properties: No such file or directory
Generating Gradle wrapper v 6.7.1
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Welcome to Gradle 4.8.1!
Here are the highlights of this release:
- Dependency locking
- Maven Publish and Ivy Publish plugins improved and marked stable
- Incremental annotation processing enhancements
- APIs to configure tasks at creation time
For more details see https://docs.gradle.org/4.8.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
/home/jitpack/build
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
------------------------------------------------------------
Gradle 4.8.1
------------------------------------------------------------
Build time: 2018-06-21 07:53:06 UTC
Revision: 0abdea078047b12df42e7750ccba34d69b516a22
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_292 (Private Build 25.292-b10)
OS: Linux 4.18.0-25-generic amd64
0m0.876s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Getting tasks: gradle tasks --all
Tasks:
⚠️ WARNING:
Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
See the documentation and examples: https://docs.jitpack.io
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1
* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@33bbcfb8] on settings 'build' of type org.gradle.initialization.DefaultSettings.
* 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 0s
Running: gradle -Pgroup=com.gitee.rumeng -Pversion=1.1.5 publishToMavenLocal
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1
* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@345ac845] on settings 'build' of type org.gradle.initialization.DefaultSettings.
* 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 0s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
FAILURE: Build failed with an exception.
* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1
* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@81a8096] on settings 'build' of type org.gradle.initialization.DefaultSettings.
* 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 0s
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
2024-04-23T07:47:56.719525482Z
Exit code: 0
⚠️ ERROR: No build artifacts found
从上开始细看发现 ERROR: Gradle wrapper not found. Please add. Using default gradle to build
项目没有找到gradle wrapper,项目的目录gradle.wrapper
下是有两个文件 gradle-wrapper.jar
与 gradle-wrapper.properties
的
再次回到项目上看,发现gitee仓库中并没有上传该文件夹,原来是已经被 .gitignore 排除了,所以项目在jitpack的云仓库中编译的时候没有找到,然后编译器就自适应给你配置了4.8.1版本的gradle;就有了后续一系列的编译问题。
解决办法:
将本地项目上使用的gradle.wrapper
上传到项目,让云端编译器编译的时候能查询到项目使用的gradle配置