Jump to content

[1.7.2] Forge gradle build failed


tiffit

Recommended Posts

So whenever I try building my mod using gradle this is what comes up:

 

 

****************************

Powered By MCP:           

http://mcp.ocean-labs.de/ 

Searge, ProfMobius, Fesh0r,

R4wk, ZeuX, IngisKahn     

MCP Data version : unknown

****************************

:compileApiJava UP-TO-DATE

:processApiResources UP-TO-DATE

:apiClasses UP-TO-DATE

:sourceMainJava UP-TO-DATE

:compileJava

warning: [options] bootstrap class path not set in conjunction with -source 1.6

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:3: error: package gnu.trove.map does not exist

import gnu.trove.map.TMap;

                    ^

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:4: error: package gnu.trove.map.hash does not exist

import gnu.trove.map.hash.TCustomHashMap;

                        ^

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:5: error: package gnu.trove.strategy does not exist

import gnu.trove.strategy.HashingStrategy;

                        ^

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:32: error: cannot find symbol

  private final TMap<ItemStack, ItemStack> recipes = new TCustomHashMap<ItemStack, ItemStack>(new HashingStrategy<ItemStack>() {

                ^

  symbol:  class TMap

  location: class PizzaOvenRecipies

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:32: error: cannot find symbol

  private final TMap<ItemStack, ItemStack> recipes = new TCustomHashMap<ItemStack, ItemStack>(new HashingStrategy<ItemStack>() {

                                                          ^

  symbol:  class TCustomHashMap

  location: class PizzaOvenRecipies

/Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/PizzaOven/PizzaOvenRecipies.java:32: error: cannot find symbol

  private final TMap<ItemStack, ItemStack> recipes = new TCustomHashMap<ItemStack, ItemStack>(new HashingStrategy<ItemStack>() {

                                                                                                  ^

  symbol:  class HashingStrategy

  location: class PizzaOvenRecipies

Note: /Users/Tiffit/Desktop/MyMods/forge/build/sources/java/com/tiffit/MoFoodMod/items/GreenApple.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

6 errors

1 warning

:compileJava FAILED

 

FAILURE: Build failed with an exception.

 

* What went wrong:

Execution failed for task ':compileJava'.

> Compilation failed; see the compiler error output for details.

 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

BUILD FAILED

 

Total time: 16.037 secs

 

Link to comment
Share on other sites

package gnu.trove.map does not exist
package gnu.trove.map.hash does not exist
package gnu.trove.strategy does not exist

You are using a library neither included in Minecraft nor Forge.

 

It is harder for us to fix your problem if you do not give us source code.

Link to comment
Share on other sites

Here is my pizzaovenrecipies class because that seems to be where the problem is comming from

 

package com.tiffit.MoFoodMod.PizzaOven;

 

import gnu.trove.map.TMap;

import gnu.trove.map.hash.TCustomHashMap;

import gnu.trove.strategy.HashingStrategy;

import net.minecraft.item.ItemStack;

 

enum PizzaOvenRecipies {

 

  INSTANCE;

 

  public void addRecipe(ItemStack input, ItemStack output) {

      recipes.put(checkNotNull(input), checkNotNull(output));

  }

 

  public static <T> T checkNotNull(T reference) {

    if (reference == null) {

      throw new NullPointerException();

    }

    return reference;

  }

 

  public ItemStack findResult(ItemStack input) {

      ItemStack result = recipes.get(input);

      if (result != null) {

        return result;

      }

return null;

  }

 

 

  private final TMap<ItemStack, ItemStack> recipes = new TCustomHashMap<ItemStack, ItemStack>(new HashingStrategy<ItemStack>() {

      @Override

      public int computeHashCode(ItemStack stack) {

     

        int result = stack.getItem().hashCode();

        result = 31 * result + stack.getItemDamage();

        return result;

      }

 

      @Override

      public boolean equals(ItemStack o1, ItemStack o2) {

        if (o1 == o2) {

            return true;

        }

        if (o1.getItem() != o2.getItem()) {

            return false;

        }

        if (o1.getItemDamage() != o2.getItemDamage()) {

            return false;

        }

        return true;

      }

  });

 

}

 

Link to comment
Share on other sites

1. Assuming you already have your workspace set up, create a new folder named "/lib" in your project directory. That's the directory that contains your /bin, /build, /gradle, and /src folders, and now also has a /lib folder.

 

2. Ask the mod author(s) for a binary distributable / source file of their mod and place it in the /lib folder you just created.

 

3. In Eclipse, right-click on your project, select "Build Path" and then "Configure Build Path". Click the "Libraries" tab, then "Add External JARs" and find the binary file that you just placed in the /lib folder.

 

4. If the API author provided a source file, open the "Referenced Libraries" tree in your package explorer, find the API binary that you just referenced and right-click on it; go to "Properties" -> "External location" -> "External file" and navigate to wherever you stored the source file, preferably right next to the binary in the /lib folder.

 

5. Run your debug configuration and see if everything is still working; if so, great! If not, you may need to run setupDev and setupDecomp workspace one more time:

 

a. gradlew setupDevWorkspace

b. gradlew setupDecompWorkspace

c. gradlew eclipse // will vary depending on your IDE

 

Once you have the debug client working, you should see that both your mod and the API are loaded; if you start a new game, anything added by the API mod will be in that game as well and should be fully functional. This is extremely handy while developing an addon or simply testing compatibility between mods.

 

You are now ready to start using the API in your mod!

 

Tutorial by coolAlias.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.