5

i could build a gradle project using android plugin. I would like to know if we can generate a valid eclipse android project? I added the below

apply plugin: 'android'
apply plugin: 'eclipse'

when i say: gradle eclipse i get

E:\proj\Platform2.0\mobile\Android\Common>gradle --build-file adt_build.gradle eclipse                                
The TaskContainer.add() method has been deprecated and is scheduled to be removed in 
Gradle 2.0. Please use the cr:eclipseClasspath                                                                                                     
:eclipseJdt                                                                                                       
:eclipseProject                                                                                                   
:eclipse                                                                                                                                                                                                                            
BUILD SUCCESSFUL                                                                                                  

but when i import the genrated project in eclipse... it doenst have the jar files imported by gradle from dependencies.

Any ideas?

chendu
  • 684
  • 9
  • 21
  • I'm looking into the same issue. Can it be that `apply plugin: 'eclipse'` only creates a normal java project in eclipse? Which Gradle and Android SDK Manager version are you using? I have posted how i solved it [here](http://stackoverflow.com/questions/16619773/failed-to-import-new-gradle-project-failed-to-find-build-tools-revision-17-0-0/17447972#17447972) – Jan-Terje Sørensen Jul 04 '13 at 08:12

2 Answers2

0

I feel like my response may be short of a true answer, but hopefully it qualifies under "Any ideas?" Anyhow...

It's hard to know without seeing more of the gradle file, but I find the warning gradle is giving you to be quite suspicious. TaskContainer.add() doesn't really jump out at me, but the suggestion does.

Please use the cr:eclipseClasspath

Now obviously deprecated doesn't automatically mean "this won't work" but gradle is suggesting you use cr:eclipseClasspath and it sounds like you are having issues with the eclipse classpath. It's hard to assume the warning and your issues are not related. Have you done any investigation along that route?

Josh Gagnon
  • 5,342
  • 3
  • 26
  • 36
  • I am quite new to gradle... errors it gives are quite criptic.. added google couldnt help either.. ;) I gave up! – chendu Jul 04 '13 at 08:50
0

see Is it possible to use the Gradle build system for Android with Eclipse?

As of April 2014 eclipse-gradle plugin is not compatible with android-gradle plugin

so having both

apply plugin: 'android'
apply plugin: 'eclipse'

is wrong start.

Eclipse files are to be added manually as described at Importing from Android Studio into Eclipse

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332