How to use buildship for Android?

I have a dummy project that I was able to compile through the buildship plugin in the eclipse IDE.

This is my local.properties file:

sdk.dir=C:/Asta/altro/adt-bundle/sdk

This is the settings.gradle file

rootProject.name = 'testgradle'

This is my build.gradle file

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.testgradle"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    lintOptions {
        abortOnError false
    }
}

sourceCompatibility = 1.6
targetCompatibility = 1.6


repositories {
    jcenter()
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile 'org.slf4j:slf4j-api:1.7.21'
    compile 'com.android.support:appcompat-v7:23.4.0'
    testCompile 'junit:junit:4.12'
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.10'
}

Despite the fact that I completely compiled apk, eclipse is not integrated: I still see the missing libraries and gives more than 100 errors! All libs libraries are perfectly managed with gradle in \ build \ intermediates \ and built in apk, but the Eclipse environment is not "live". I would like to use gradle to load and explode libraries, and then to tell eclipse and let it make apk with its own constructor.

+4

Source: https://habr.com/ru/post/1656719/


All Articles