Intellij 12 & Gradle - Three questions

Question #1 - Is it possible to successfully compile and run/debug in the Android emulator an Android project using Gradle in Intellij 12?

I tried to make this work but as I explain here, I failed.

Question #2 - Can Gradle use in Intellij 12 for a Java only project (e.g. not Android) and a simultaneous instance of Android Studio 0.3.0 using Gradle Co-Exist?

When I run both IDEs at the same time (on different projects) I get all sorts of odd Gradle errors. Everything from not enough memory in the VM (when I have over a gig of RAM completely free) to null pointers to build failures. These problems all seem to go away if I only run one or the other but that's a problem because I'm developing a peer to peer system that needs to be tested with both running. I have tried to change the Gradle user folders to different folders but that doesn't seem to fix things.

Question #3 - Is it 'safe' to open an Android 0.3.0 project in Intellij 12?

I unfortunately did this with my key project (I was trying to unify everything in IDEA rather than split across two IDEs) and the project got horked. I fixed most of the problems but I still can't get the thing to run right. :( At this point I'm re-creating the entire project from scratch in Android 0.3.0 to try to get it back in a running state. May I assume the obvious - that it's a really bad idea to open an Android 0.3.0 project in Intellij 12? (As opposed to, it's o.k. and I somehow got really unlucky)

          Thanks,

              Yaron

4 comments

Question #1 AFAIK, there was no support for Gradle-based Android project in IJ 12

Question #2 I'd recommend to try IJ EAP 13 for such activities, if something will fail, please file an issue at http://youtrack.jetbrains.com/

Question #3 It's not 'safe', there is no backward compatibility between gradle projects of IJ 12 and IJ 13 (and Android Studio 0.3.0 based on IJ 13 EAP).

Gradle build scripts used as a "single source of truth" for IJ 13 gradle plugin, so it's should not be an big issue if Idea project files (*.iml, .idea/*, etc) for IJ 13 gradle project will be broken. Since you can remove it at all and import the project from scratch.


-Vlad

0

I am double checking the following because it will have a major effect on my work. Sorry if I seem to be asking the same question twice.

Statement #1 - It is not safe to use Gradle in IJ12 and Android Studio 0.3.0.
Statement #2 - However it *should* be safe with IJ13 and Android Studio 0.3.0 since they are the same code base.

Are these statements correct?

      Thanks,

             Yaron

0

Statement #1 - It is not safe to use Gradle in IJ12 and Android Studio 0.3.0.
IJ and Android Studio should not interfere with each other if there is a different projects opened. So, the statement should not be correct.

Statement #2 - However it *should* be safe with IJ13 and Android Studio 0.3.0 since they are the same code base.
Yes, it's a final goal to have those fully compatible. All breaking issues will be considered as bugs and will be fixed.

-Vlad

0

As I mentioned in my original mail I ran into endless gradle problems when I had a Java Gradle project in IJ 12 and a completely unrelated Android Gradle project in Android Studio 0.3.0 running next to each other at the same time on the same machine. Again, two separate, unrelated projects. The problem was so bad that I gave up and moved the Java project to Maven and all the gradle failures went away but one. The one remaining one is a complaint in Android Studio 0.3.0 about not having enough memory to run the Gradle VM which is bizarre since I have over a gig of RAM completely unallocated on my machine. I fixed that one by passing org.gradle.jvmargs=-Xms128m -Xmx256m to the Gradle VM and then it ran fine.

So I have to wonder if there isn't some kind of bug in Gradle support in IJ 12 and how it interacts with Android Studio 0.3.0? I did notice that the failures often referenced my user .gradle directory (which I never, ever, touched directly) which was shared by both IDEs. But even when I tried to change the directory (so each IDE would use a different one) the problems continued. In fact the problems didn't all go away until I completely disabled Gradle support in IJ 12 by deleting the path in Settings to Gradle home.

Maybe the problem is that I was using my own install of Gradle 1.8 and the default install of Gradle in Android Studio 0.3.0? I don't know. But since I switched to Maven in IJ 12 life has been better.

0

Please sign in to leave a comment.