Asaf
Asaf

Reputation: 2035

Exporting an eclipse project as gradle

I have been trying to export my eclipse project as a gradle build file to use it with Android Studio but I can't seem to make it work correctly. When I click "Finish" nothing happens. If I repeatedly click it, I can see a progress bar that shows for a millisecond and then vanishes.

My ADT is version 22.3 (which is the latest) and I have tried all of the solutions I found on google as well.

Similar questions can be found here: Eclipse Gradle export of Android project does nothing Cannot generate gradle.build files from Eclipse

As you can see, there is not really a solid solution for this problem, but people wrote they created it manually. I don't know how to do so though.

Is there any solution for this problem that I haven't heard of? If not, how can I create the file manually?

Upvotes: 9

Views: 9435

Answers (3)

Paul Verest
Paul Verest

Reputation: 64031

For not trivial Android project you should do it manually.

For the latest build.gradle template for classic Android project check gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.

You can continue to develop in Eclipse with ADT and run Gradle build using Nodeclipse/Enide Gradle for Eclipse (marketplace)

Some screenshots for Gradle for Eclipse:

Upvotes: 0

drpawelo
drpawelo

Reputation: 2580

Generating build.gradle files FIRST FOR ALL of the projects in my dependencies ONE AFTER ANOTHER worked for me.

I generated build.gradle (with export wizrd for facebook, play and whatever other projects I imported and used in my project).

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007658

Apparently, the current edition of the export-to-Gradle support in Eclipse cannot handle a project that is attached to an Android library project. In that case, you would need to (temporarily) detach the Android library project, export the main project, then modify build.gradle to use the library project (manually or via Android Studio).

Upvotes: 16

Related Questions