Jump to content

[solved]Build.gradle doesn't import in intellij


Recommended Posts

Posted

Hi all,

 

 

I am trying to use forge MDK to writing a mod with Intellij idea. I followed all the guides of README.txt file and even other online guides. I don't know why but when I import the build.gradle project in Intellij the Ide blocks in gradle: run build and doesn't import the projects someone with the same problem?

Posted

I may be an idiot that doesn't use IneliJ but I'm pretty sure you do not import the build.gradle project...

I was indeed an idiot...

 

I did not understand your answer.

 

I followed this guide that are in the README.txt file:

 

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

 

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

 

Windows: "gradlew setupDecompWorkspace"

Linux/Mac OS: "./gradlew setupDecompWorkspace"

 

Step 3: After all that finished, you're left with a choice.

For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

 

If you preffer to use IntelliJ, steps are a little different.

1. Open IDEA, and import project.

2. Select your build.gradle file and have it import.

3. Once it's finished you must close IntelliJ and run the following command:

 

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

 

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)

 

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.

 

Should it still not work,

Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

 

at the step 3 the underlined and bold text I cannot import the file.

 

I have just launch the gradlew program with arg --info and in the outputs I found that error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I think that it is important but I don't know I to resolve the problem.

Posted

I may be an idiot that doesn't use IneliJ but I'm pretty sure you do not import the build.gradle project...

I was indeed an idiot...

 

I did not understand your answer.

 

I followed this guide that are in the README.txt file:

 

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

 

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

 

Windows: "gradlew setupDecompWorkspace"

Linux/Mac OS: "./gradlew setupDecompWorkspace"

 

Step 3: After all that finished, you're left with a choice.

For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

 

If you preffer to use IntelliJ, steps are a little different.

1. Open IDEA, and import project.

2. Select your build.gradle file and have it import.

3. Once it's finished you must close IntelliJ and run the following command:

 

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

 

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)

 

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.

 

Should it still not work,

Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

 

at the step 3 the underlined and bold text I cannot import the file.

 

I have just launch the gradlew program with arg --info and in the outputs I found that error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I think that it is important but I don't know I to resolve the problem.

Are you sure you did steps 1/2?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I am very sure.

 

I did that steps 10 times, with several MDKs (1.10.2, 1.9, 1.10, 1.9.4). Always the same problem.

 

When I follow the step 2 if I add the arg --info to the command I always find the same error:

file or directory '/Users/noemurr/Downloads/forge-1.10.2-12.18.1.2011-mdk/src/api/resources', not found

 

I also tried to use eclipse and using it I can open the project but the ide doesn't find the external libraries.

 

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Is that not step 2?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I always do it like this:

 

 

Extract MDK into a directory

Edit build.gradle to suit the project, add 'idea{module{inheritOutputDirs = true}}' to the end of it

Open CMD window in that directory

Run 'gradlew setupDecompWorkspace --refresh-dependencies', wait for it to finish

Import the build.gradle file in IntelliJ with "Use auto-import" checked, wait for it to finish

Run the 'genIntellijRuns' task in IntelliJ's Gradle sidebar and reopen the project when prompted

If the forge source isn't in the external libraries after all that, I close IntelliJ and open a CMD window in the project directory and do 'gradlew idea --refresh-dependencies'.

 

 

It sounds like adding that line to the build.gradle file may help?

 

It works! I had already added the line idea{module{inheritOutputDirs = true}} but I didn't run again the ./gradlew setupDecompWorkspace.

 

thanks for your help!

Is that not step 2?

no. Step 2 indicates to launch the command not to add lines and than relaunch the command.

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.