microsoft / malmo

Project Malmo is a platform for Artificial Intelligence experimentation and research built on top of Minecraft. We aim to inspire a new generation of research into challenging new problems presented by this unique environment. --- For installation instructions, scroll down to *Getting Started* below, or visit the project page for more information:
https://www.microsoft.com/en-us/research/project/project-malmo/
MIT License
4.03k stars 601 forks source link

Issue with MixinGradle #942

Open verityw opened 5 months ago

verityw commented 5 months ago

I am using MineDojo and MineRL. The two of them share a part of the build.gradle code, specifically:

dependencies {
        classpath 'org.ow2.asm:asm:6.0'
        classpath('com.github.SpongePowered:MixinGradle:dcfaf61'){ // 0.6
            // Because forgegradle requires 6.0 (not -debug-all) while mixingradle depends on 5.0
            // and putting mixin right here will place it before forge in the class loader
            exclude group: 'org.ow2.asm', module: 'asm-debug-all'
        }
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
    }

However, when running MineDojo's validate_install.py script or trying to download / build MineRL, it yields:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Minecraft'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.github.SpongePowered:MixinGradle:dcfaf61.
     Searched in the following locations:
       - https://jitpack.io/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://jitpack.io/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
       - https://jcenter.bintray.com/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://jcenter.bintray.com/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
       - https://repo.maven.apache.org/maven2/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://repo.maven.apache.org/maven2/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
       - https://maven.minecraftforge.net/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://maven.minecraftforge.net/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
       - https://plugins.gradle.org/m2/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.pom
       - https://plugins.gradle.org/m2/com/github/SpongePowered/MixinGradle/dcfaf61/MixinGradle-dcfaf61.jar
     Required by:
         project :

Has the repo for com.github.SpongePowered:MixinGradle:dcfaf61 been changed or something? How can I fix this?

verityw commented 5 months ago

I found that I had a cached copy of the requisite jar file, which I am hosting on GitHub here: https://github.com/verityw/MixinGradle-dcfaf61

After cloning, in the build.gradle file, add this to the repositories{} section:

maven {
            url 'file:/path/to/that/repo'
        }

Then, change the classpath for MixinGradle to:

classpath('MixinGradle-dcfaf61:MixinGradle:dcfaf61'){ // 0.6
            // Because forgegradle requires 6.0 (not -debug-all) while mixingradle depends on 5.0
            // and putting mixin right here will place it before forge in the class loader
            exclude group: 'org.ow2.asm', module: 'asm-debug-all'
        }

Hopefully the actual URL gets fixed soon though!

qinglongyu23 commented 2 months ago

This one also do the trick with official spongepowerd artifacts (dcfaf61 seems to equivalent to 0.6-SNAPSHOT)

    repositories {

        maven { url 'https://repo.spongepowered.org/repository/maven-public/' }
    }
    dependencies {

        classpath('org.spongepowered:mixingradle:0.6-SNAPSHOT'){ // 0.6
            // Because forgegradle requires 6.0 (not -debug-all) while mixingradle depends on 5.0
            // and putting mixin right here will place it before forge in the class loader
            exclude group: 'org.ow2.asm', module: 'asm-debug-all'
        }