minerllabs / minerl

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package
http://minerl.io/docs/
Other
654 stars 151 forks source link

Issue with MixinGradle #744

Open verityw opened 5 months ago

verityw commented 5 months ago

I am using MineDojo, which shares some parts of the build.gradle file as MineRL. In particular, it has:

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 their basic validate_install.py script, 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?

Miffyli commented 5 months ago

Hey. If you are using MineDojo, you should ask questions on MineDojo repo. We here do not have too much familiarity with it or the changes they have made to MineRL (if any). Generally these compliation issues boil down to having wrong java/javac version (sometimes multiple javas on same machine confuse the build system), or sometimes the repos are offline for a moment.

We also did some updates to build scripts in this MineRL repo, which might need reflecting on MineDojo side, but I have not looked into that.

verityw commented 5 months ago

Thanks for the reply -- I posted there as well.

I just tried installing MineRL (via pip install minerl==0.4.4) and it actually gave me the exact same error as above. Note that I tried installing the latest version via pip install minerl and pip install git+https://github.com/minerllabs/minerl, and while they did not error out, it seems like they did not install properly, as following the demo and running import minerl doesn't work.

Additionally, here is the output of java -version

openjdk version "1.8.0_392"
OpenJDK Runtime Environment (build 1.8.0_392-8u392-ga-1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.392-b08, mixed mode)

so it seems like it's not(?) a Java version issue.

makolon commented 5 months ago

I'm facing the same error. It seems the following links are expired or cannot access temporally.

- 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

As an additional note, I was able to install minerl==0.4.4 one week ago using the command pip install git+https://github.com/minerllabs/minerl.git@v0.4.4.

Miffyli commented 5 months ago

I tried clearing my caches and doing pip install git+https://github.com/minerllabs/minerl, and it ran succesfully. Note that the script might appear as "completed" even if the building phase failed (you need to copy-paste the full script). I had to run the installation twice, as downloadAssets phase sometimes flakes out, but usually second try fixes the downloads.

The repos sometimes have trouble depending on your region :( . I wonder if they are not available in your areas, or if your networks are blocking them. Another thing is that they do sometimes go offline at random times, and trying again another day might help.

makolon commented 5 months ago

Thank you for trying that, and thank you for sharing the helpful information! I forgot to mention, while you can install the latest version with pip install git+https://github.com/minerllabs/minerl, I encounter an error when I try to install version v0.4.4 using the command pip install git+https://github.com/minerllabs/minerl.git@v0.4.4. Is there a way to install version v0.4.4?

It might be, as you said, that the repos is not available in my area at the moment, so I'll try again after a little while...

Miffyli commented 5 months ago

v0.4.4 might have some settings in the config that are not up to date anymore, so it might require bringing some fixes from dev branch :( . FYI MineDojo is based off v0.3.7, which (v0.3.7) is more stable and faster, just lacking some features. v0.4.4 is bit of a obscure middle-ground.

Pasting full log of errors could help pointing the error.

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!

makolon commented 5 months ago

Thank you for the instructions! I'll try that out!