1

I am trying to open this android app in eclipse

I have followed the instructions in the README. I ran this command in CMD gradlew assemble

It generated a folder called Build with many files in it. definitely not an Android eclipse project. it also failed at the end with this error:

java.io.IOException: Please correct the above warnings first. Execution failed for task ':app:proguardRelease'.

I just want to open this project in enclipse. what do I need to do?

124697
  • 22,097
  • 68
  • 188
  • 315

3 Answers3

1

I believe that is not possible automatically (check this out). But you can do it manually by yourself, linking the source folders to the Java Build Path on Eclipse.

Community
  • 1
  • 1
dum4ll3
  • 1,417
  • 2
  • 12
  • 17
0

If the build.gradle has the eclipse plug-in declared...

apply plugin: 'eclipse'
apply plugin: 'idea'

You can get it to generate a .classpath and .project from the command line like

gradle eclipse

Then, in eclipse, you just Import the project. Its pretty much the same story as you add dependencies to your project through the build.gradle file. To get the new dependencies into the eclipse project, you just re-run "gradle eclipse" and refresh the project in eclipse.

It works for me, but I don't do Android development (yet). But, lookie here, apparently there is also some Android plug-in for gradle (http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure), I'm betting these things all work together to make the "gradle eclipse" thing work.

Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
  • Can't this be applied without modifying `build.gradle`? or is it very standard in the world of gradle to stuff these things into the build definition for any good reason? – matanster Mar 13 '16 at 14:35
0

What is possible with Eclipse now is

.1. import the project as general project

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>OpenSpritz-Android</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
    </buildSpec>
    <natures>
    </natures>
</projectDescription>

import-android-gradle-as-general-project

.2. Put 2 Eclipse . "dot" files into modules into /OpenSpritz-Android/app/src/main and /OpenSpritz-Android/lib/src/main

add-eclipse-files

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>OpenSpritz-Android-app</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ApkBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="java"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>

.3. Import as Existing Android Code into Workspace

results

you can then browse code in familiar way, but even after that you won't be able to run with Eclipse ADT.

.4.

Now you can run build and tasks with gradle CLI or Nodeclipse/Enide Gradle for Eclipse (marketplace)

start

discuss at https://github.com/Nodeclipse/nodeclipse-1/issues/148

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