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

Cannot build with gradle #72

Closed
ghost opened this issue Nov 7, 2020 · 4 comments
Closed

Cannot build with gradle #72

ghost opened this issue Nov 7, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 7, 2020

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
Copy link
Author

ghost commented Nov 7, 2020

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
Copy link

ghost commented Nov 29, 2020

do you have jdk 11 and java 1.8 installed?

@ghost
Copy link

ghost commented Nov 29, 2020

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.

@modmuss50
Copy link
Member

👋 We use the issue tracker exclusively for final bug reports and feature requests. However, this issue appears to be better suited for either a discussion thread, or a message on our discord server. Please post your request on one of these, and the conversation can continue there.

@modmuss50 modmuss50 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant