Blaze Tama
Blaze Tama

Reputation: 10948

Can't run imported gradle android project in Eclipse

First, im new in gradle so please bear with me.

I successfully build and imported this project with gradle & eclipse on ubuntu 13.10. This is what i did :

  1. run gradle build in terminal (success)
  2. add apply plugin: 'eclipse' in the build.gradle
  3. run gradle eclipse in terminal (success)
  4. import it as existing project on eclipse

The problem is, when i tried to run the project, eclipse read it as "normal" java program, not the android one. This is the SS :

enter image description here

The main project in my workspace is not in eclipse format.

And this is its properties :

enter image description here

Notice there's no android tab in it's properties. And i cant run it as android application.

Am i missing something? Please kindly help me.

Thanks for your help.

Upvotes: 3

Views: 4526

Answers (2)

Paul Verest
Paul Verest

Reputation: 64030

Usually to develop Android in Eclipse you need to install ADT into Eclipse or start with ADT-Bundle (Android IDE) from Google. (You have not as Preferences missing Android group)

However ADT does not have gradle support. And Android Studio is still not even yet beta (preview or alpha, bleeding edge, need to update with almost every build).

There is Nodeclipse/Enide Gradle for Eclipse (marketplace), that lets launch gradle build even on general project.

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.

This lets create new Android project in Eclipse with ADT and use ADT tools for most of things, but additionally have newer build with gradle and execute defined gradle tasks

But for Android project with several modules (as in this case) you would need to DIY do it yourself: try to configure Eclipse .classpath to correct values, as gradle eclipse task won't yet do it all for you.

Upvotes: 2

Radim
Radim

Reputation: 4808

Eclipse plugin in Gradle that you have used does not support Android projects - they are significantly different from regular Java projects. Some things can work but there will be a lot of things missing including Android nature for generated projects.

And the ADT plugin provided by Google does not support Gradle projects yet as the team focuses on Android Studio first. http://tools.android.com/tech-docs/new-build-system can give you some ideas about the current state.

Upvotes: 1

Related Questions