Run multiple configurations simultaneously. Intellij IDEA + gradle

Answered

I cannot run two configurations simultaneously in Intellij IDEA (2020.1.2 version). When I run one of my "Run configuration" (server for example) I have "Gradle build running" info until I close this process. Next "Run configuration" runs automatically only after first process close. So I'm unable to run two processes at the same time. I had no problem to run many configurations on Android Studio but had to change to IDEA for other reasons.

0
10 comments

You can use Compound Run/Debug Configurations to launch multiple configurations at once (corresponding settings page).

 

0
Avatar
Permanently deleted user

It doesn't work. It behaves the same as earlier. I've created Compound Run Configuration with 2 processes and second process is waiting with "Gradle Build Running" info till I stop first process.

0

What kind of processes are those? Can you attach screenshots of each run config window?

Please also provide a demo project where the issue can be reproduced. You can upload it to https://uploads.jetbrains.com/ and provide the upload id.

0
Avatar
Permanently deleted user

Sorry for deleyed response.

Everything works fine (I can run two modules simultaneously) where there are only 2 java gradle modules ("module1" and "module2"). Sample project here: Upload id: 2020_12_30_BCqPiNPQHkNrGQ82 (file: MultipleProjectsTest_ok.zip). It's not ok when I add third module: android library. Here is the same sample project with 2 java gradle modules ("module1" and "module2") and with additional android library module ("mylibrary"): Upload id: 2020_12_30_YD8wSCeDtjiH7kpj (file: MultipleProjectsTest_notOk.zip). In second scenario when I run module1 it has to finish to run module2. It's not possible to run them two simultaneously.

0

>It's not ok when I add third module: android library

Are you sure the Android module is imported correctly? Do you get any errors or warnings related to it when building the project?

Does this happen if the third module is a simple Java one?

0
Avatar
Permanently deleted user

Are you sure the Android module is imported correctly?

What do you mean? I've added new empty Android module (right click project, select "New->Module.." and then choose "Android->Android Library")

Do you get any errors or warnings related to it when building the project?

Yes, because I forget to add repositories to android module .gradle file, but it behave the same after adding repositories. Here is a corrected project: Upload id: 2020_12_31_DpXFrt1fvG8e4gBQ (file: MultipleProjectsTest_notOk2.zip)

Does this happen if the third module is a simple Java one?

No, it happens only if I add an Android module. I would like to emphasize that Android Library module is empty, it not contains any java code and I try to run simultaneously two java modules which contains independent code. Everything is visible and clear in attached sample project. Below is the only code inside module1 and module2 single class file. It does not contain any dependency to android library module.

public static void main(String args[]){
System.out.println( "Module 1 running" );
for( int i = 0; i < 100; i++ ) {
System.out.println( i );
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
0

Thank you, I will look into it and get back to you.

0

@...

Thank you, we were able to reproduce the problem.

You mentioned that running two modules simultaneously with a similar setup worked for you in Android Studio. Can you confirm that it works in AS for the test project that you uploaded? What is the version of Android Studio that you are using?

0
Avatar
Permanently deleted user

I've tried to run two modules simultaneously in test project on Android Studio 4.1.1 - it doesn't work

It works on Android Studio 2.3.2, but I had to change configuration files - here is the sample project Upload id: 2021_01_12_Q45eWTJbBFCypdjF (file: MultipleProjectsTest_AS.zip)

0

Thank you.

I created a bug report for this on our issue tracker: IDEA-259311. Responsible developers will look into it shortly.

Feel free to follow the issue to stay updated on the progress of the investigation, and leave additional comments.

See this article if you are not familiar with YouTrack.

0

Please sign in to leave a comment.