简体   繁体   English

从android gradle插件生成eclipse项目

[英]Generating eclipse project from android gradle plugin

i could build a gradle project using android plugin. 我可以使用android插件构建一个gradle项目。 I would like to know if we can generate a valid eclipse android project? 我想知道我们是否可以生成一个有效的eclipse android项目? I added the below 我在下面添加了

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

when i say: gradle eclipse i get 当我说:gradle eclipse我得到

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. 但是当我在eclipse中导入生成的项目时...它确实有gradle从依赖项导入的jar文件。

Any ideas? 有任何想法吗?

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. 如果没有看到更多的gradle文件,很难知道,但我发现警告gradle让你非常怀疑。 TaskContainer.add() doesn't really jump out at me, but the suggestion does. TaskContainer.add()并没有真正跳出来,但建议确实如此。

Please use the cr:eclipseClasspath 请使用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. 现在明显被弃用并不会自动意味着“这不会起作用”,但gradle建议您使用cr:eclipseClasspath,这听起来像是在遇到eclipse类路径问题。 It's hard to assume the warning and your issues are not related. 很难假设警告并且您的问题无关紧要。 Have you done any investigation along that route? 你沿那条路走过了吗?

see Is it possible to use the Gradle build system for Android with Eclipse? 是否有可能使用Eclipse的Gradle构建系统与Eclipse?

As of April 2014 eclipse-gradle plugin is not compatible with android-gradle plugin 截至2014年4月,eclipse-gradle插件与android-gradle插件不兼容

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 Eclipse文件将按照从Android Studio导入到Eclipse中的描述手动添加

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM