Cannot build with gradle #72

Open
opened 2020-11-07 11:55:54 +00:00 by ghost · 3 comments
ghost commented 2020-11-07 11:55:54 +00:00 (Migrated from github.com)

I always encounter this exception when running gradle tasks and gradle build:

> Configure project :
Fabric Loom: 0.5.34 Build(jenkins #34)
Repository https://jcenter.bintray.com/ replaced by http://maven.aliyun.com/nexu
s/content/repositories/jcenter.
:setting up loom dependencies
:merging jars

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'fabric-example-mod'.
> Failed to provide com.mojang:minecraft:1.16.3 : zip END header not found

* 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 10s

Could anyone tell me what to do? Thanks

I always encounter this exception when running `gradle tasks` and `gradle build`: ``` > Configure project : Fabric Loom: 0.5.34 Build(jenkins #34) Repository https://jcenter.bintray.com/ replaced by http://maven.aliyun.com/nexu s/content/repositories/jcenter. :setting up loom dependencies :merging jars FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'fabric-example-mod'. > Failed to provide com.mojang:minecraft:1.16.3 : zip END header not found * 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 10s ``` Could anyone tell me what to do? Thanks
ghost commented 2020-11-07 11:57:29 +00:00 (Migrated from github.com)

Further information:
gradle.properties

# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
	# check these on https://fabricmc.net/use
	minecraft_version=1.16.3
	yarn_mappings=1.16.3+build.17
	loader_version=0.10.0+build.208

# Mod Properties
	mod_version = 1.0.0
	maven_group = net.fabricmc
	archives_base_name = fabric-example-mod

# Dependencies
	# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
	fabric_version=0.22.0+build.408-1.16

build.gradle

plugins {
	id 'fabric-loom' version '0.5-SNAPSHOT'
	id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

dependencies {
	//to change the versions see the gradle.properties file
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
	mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
	modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

	// Fabric API. This is technically optional, but you probably want it anyway.
	modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

	// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
	// You may need to force-disable transitiveness on them.
}

processResources {
	inputs.property "version", project.version

	filesMatching("fabric.mod.json") {
		expand "version": project.version
	}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
	options.encoding = "UTF-8"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
	classifier = "sources"
	from sourceSets.main.allSource
}

jar {
	from "LICENSE"
}

// configure the maven publication
publishing {
	publications {
		mavenJava(MavenPublication) {
			// add all the jars that should be included when publishing to maven
			artifact(remapJar) {
				builtBy remapJar
			}
			artifact(sourcesJar) {
				builtBy remapSourcesJar
			}
		}
	}

	// select the repositories you want to publish to
	repositories {
		// uncomment to publish to the local maven
		// mavenLocal()
	}
}

Minecraft Java Edition 1.16.3, HMCL Launcher, Offline Mode

Further information: gradle.properties ``` # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use minecraft_version=1.16.3 yarn_mappings=1.16.3+build.17 loader_version=0.10.0+build.208 # Mod Properties mod_version = 1.0.0 maven_group = net.fabricmc archives_base_name = fabric-example-mod # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api fabric_version=0.22.0+build.408-1.16 ``` build.gradle ``` plugins { id 'fabric-loom' version '0.5-SNAPSHOT' id 'maven-publish' } sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group dependencies { //to change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. } processResources { inputs.property "version", project.version filesMatching("fabric.mod.json") { expand "version": project.version } } // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { options.encoding = "UTF-8" } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { classifier = "sources" from sourceSets.main.allSource } jar { from "LICENSE" } // configure the maven publication publishing { publications { mavenJava(MavenPublication) { // add all the jars that should be included when publishing to maven artifact(remapJar) { builtBy remapJar } artifact(sourcesJar) { builtBy remapSourcesJar } } } // select the repositories you want to publish to repositories { // uncomment to publish to the local maven // mavenLocal() } } ``` Minecraft Java Edition 1.16.3, HMCL Launcher, Offline Mode
ghost commented 2020-11-29 14:13:45 +00:00 (Migrated from github.com)

do you have jdk 11 and java 1.8 installed?

do you have jdk 11 and java 1.8 installed?
ghost commented 2020-11-29 14:15:12 +00:00 (Migrated from github.com)

and try reinstalling 1.16.3.

And this repo is now updated to 1.16.4. That may be the cause if you dont have 1.16.4 installed.

and try reinstalling 1.16.3. And this repo is now updated to 1.16.4. That may be the cause if you dont have 1.16.4 installed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Steven/fabric-example-mod#72