Skip to content

Modules that export same package to same third module causes runtime error #965

@telpirion

Description

@telpirion

Issue Description

Adding the Google Cloud Vertex AI library for Java to a MDK build.gradle file causes a runtime error:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraftforge.bootstrap.Bootstrap.bootstrapMain(Bootstrap.java:133)
        at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:53)
        at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:19)
Caused by: java.lang.module.ResolutionException: Modules gax.grpc and proto.google.common.protos export package com.google.longrunning to module io.grpc.util
        at java.base/java.lang.module.Resolver.resolveFail(Unknown Source)
        at java.base/java.lang.module.Resolver.failTwoSuppliers(Unknown Source)
        at java.base/java.lang.module.Resolver.checkExportSuppliers(Unknown Source)
        at java.base/java.lang.module.Resolver.finish(Unknown Source)
        at java.base/java.lang.module.Configuration.<init>(Unknown Source)
        at java.base/java.lang.module.Configuration.resolveAndBind(Unknown Source)
        at java.base/java.lang.module.Configuration.resolveAndBind(Unknown Source)
        at net.minecraftforge.bootstrap@2.1.7/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:166)
        ... 5 more

Repro steps

  1. Download the current MDK and go through set up steps.
  2. Add the following code to build.gradle.
    minecraftLibrary platform('com.google.cloud:libraries-bom:26.59.0')
    minecraftLibrary("com.google.cloud:google-cloud-vertexai:1.20.1")
    minecraftLibrary("com.google.api.grpc:proto-google-cloud-vertexai-v1:1.1.0")
  1. Run the runClient Gradle task.

Expected result: Minecraft launches
Actual result: runtime error (see issue description).

Environment

  • MacOS
  • VSCode
  • Vertex AI library v1.20.1
  • MDK downloaded from Forge site

Troubleshooting steps:

I have looked on the ForgeGradle public forum and found similar issues:

Steps tried to fix this issue:

  • Changed the order of the Gradle plugins in my build.gradle
  • Added an exclude block to my minecraftLibrary dependencies
  • Changed Gradle version
  • Reviewed documentation, including this page

Suggestions

I don't know what the root cause of this issue is, although I suspect that it might be related to the issue discussed in #624 . I would update the public documentation for ForgeGradle to include troubleshooting tips or work arounds for this issue. If this is a known issue, then it should be stated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FG6This request is for FG 6

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions