Mekanism

Mekanism

111M Downloads

Error: package does not exist

jfelipearaujo opened this issue ยท 2 comments

commented

Issue description

Hi guys,

I'm facing the error for each Mekanism import when I try to build the mod.

See an example:

error: package mekanism.common.capabilities does not exist
  import mekanism.common.capabilities.Capabilities;

build.gradle:

repositories {
   maven { //Mekanism
      url = 'https://modmaven.dev/' 
    } 
}

dependencies {
    compileOnly "mekanism:Mekanism:${mekanism_version}:api"
    runtimeOnly fg.deobf("mekanism:Mekanism:${mekanism_version}")
}

I don't know what can I do to solve this issue.

Steps to reproduce

1 - Configure build.gradle
2 - Build the mod

Minecraft version

1.19.2 (Latest)

Forge version

43.1.3

Mekanism version

Current Dev Branch (Manually Compiled)

Other relevant versions

mekanism_version=1.19.2-10.3.3.470

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

https://pastebin.com/eZZkQ4YA

commented

You add mekanism:Mekanism:${mekanism_version}:api to your project which does not contain the common package

You could remove the api

But you shouldn't use that class anyway. Forge has a way specific way to use capabilities from other mods -> https://github.com/SirEndii/AdvancedPeripherals/blob/dev/0.8/src/main/java/de/srendi/advancedperipherals/common/addons/mekanism/MekanismCapabilities.java#L11

commented

As states you only are depending on things that are exposed in the API. So don't use internal stuff when it isn't needed. Define your own capability reference and use that instead.