2

I've read a lot of post regarding this topic but all the answers are quite old and noone solves this specific aspects. I'm wondering if there is a clean way to be able to start working with Gradle to build the same Android applications I used to build with the traditional "Eclipse + ADT plugin" way. In other words I'm developing Android apps with Eclipse and ADT plugin for some time now. Anyway I started to read about Gradle and I'm really interested in it, thus I woul dlike to start working with this new approach. Anyway I don't want to switch directly to Android Studio because:

  • I also use Eclipse to develop standard Java application and sometimes also C++ applications;
  • my colleagues still work with Eclipse and for compatibility reason I cannot move directly to Android Studio;
  • I should still be able to deploy project and quickly make some modifications to the app I'm working on right now and I cannot lose too much time changing completely programming paradigm (IDE + building with gradle) all in one time. That's why I would prefere a softer transition to gradle build tool.

I've also read this answer and started to follow the proposed solution but it seems very long if you already have a complex project. Is there any way to facilitate this change to gradle building? (I've already installed Gradle IDE 3.6.3, ADT 23.0.4 and I'm working with Eclipse Luna - 4.4.1).

Thanks a lot for any help!

Community
  • 1
  • 1
Andre
  • 489
  • 1
  • 6
  • 17
  • You can start by running the Gradle export process from within Eclipse (File > Export IIRC). The resulting Gradle file is probably out of date, though, as AFAIK the export code has not been updated in quite some time. However, it will be set up to teach Gradle for Android how to build an Eclipse-style project using the Eclipse project structure. Most of [my book examples](https://github.com/commonsguy/cw-omnibus) are set up to be usable in Eclipse yet buildable via Gradle for Android, so you could look at their `build.gradle` files as well. – CommonsWare Feb 06 '15 at 15:57
  • You need to get on android studio because Gradle is built in and eclipse is not part of the android future. Manually create the project in android studio one file at a time. This will get you familiarity with android studio IDE. I had a bad time attempting what you are trying to and also a bad time with the android studio import wizard. I was successful manually importing one file at a time and it also built my confidence with the android studio ide. – danny117 Feb 06 '15 at 18:21
  • @CommonsWare I followed your instructions, I see the File -> Export -> Android -> Generate Gradle Build file. The build.gradle was correctly generated but I had no option to execute or run it. I had to add to my installation set up both Gradle environment (from [http://www.gradle.org]) and Nodeclipse/Enide Gradle for Eclipse v0.17 [link](http://marketplace.eclipse.org/content/gradle). Now the build.gradle is mappe with gradle icon at least, but still I don't have any menu voice to run it. – Andre Feb 09 '15 at 10:55
  • It may be related to an error I see in the "Error Log": Plug-in 'org.springsource.ide.eclipse.gradle.ui' contributed an invalid Menu Extension (Path: 'org.springsource.ide.eclipse.gradle.menu' is invalid): org.springsource.ide.eclipse.gradle.ui.actions.Console. I cannot find any solution to solve it... The same error related to other plugins seems always to be related to some bugs. – Andre Feb 09 '15 at 10:58
  • Sorry for corrupted link to gradle web site, this should be correct: [gradle](http://www.gradle.org) – Andre Feb 09 '15 at 11:02
  • "The build.gradle was correctly generated but I had no option to execute or run it" -- Eclipse doesn't run it. Use it from the command line. – CommonsWare Feb 09 '15 at 12:34
  • Taking into account what you already wrote, what I had already read and the errors I'm facing now, I can conclude there's no full working integration of gradle for Android in Eclipse up to now. Anyway, in my original question I mentioned that the possibility to build projects in the same way for Android-Java apps, plain Java application and C++ application was interesting in order to maintain a common approach... The question now is: what about non-Android projects? Is the gradle integration missing for those projects either? Am I able only to write the build.gradle,but not to run it? – Andre Feb 10 '15 at 08:23

0 Answers0