Eclipse fail to import smack 4.1 by gradle

Hi all,

I got News that smack 4.1 support Android natively. So, i upgrade from asmack-android-16 to smack 4.1.

I follow Smack 4.1 Readme and Upgrade Guide · igniterealtime/Smack Wiki · GitHub to upgrade my project.

Unfortunately, i can’t smoothly upgrade it. I got some error message when got the lib by using gradle.

Error message :

My build.grade

buildscript {

repositories {

maven {

        url '[https://oss.sonatype.org/content/repositories/snapshots](https://oss.sonatype.org/content/repositories/snapshots)'

}

jcenter()

}

dependencies {

//classpath ‘com.android.tools.build:gradle:0.5.+’

classpath ‘com.android.tools.build:gradle:1.0.+’

}

}

apply plugin: ‘eclipse’

dependencies {

compile fileTree(dir: ‘libs’, include: ‘*.jar’)

compile “org.igniterealtime.smack:smack-android-extensions:4.1.1-SNAPSHOT”

compile “org.igniterealtime.smack:smack-experimental:4.1.1-SNAPSHOT”

compile “org.igniterealtime.smack:smack-tcp:4.1.1-SNAPSHOT”

}

android {

compileSdkVersion 19

buildToolsVersion “18.1.0”

sourceSets {

main {

manifest.srcFile ‘AndroidManifest.xml’

java.srcDirs = []

resources.srcDirs = []

aidl.srcDirs = []

renderscript.srcDirs = []

res.srcDirs = [‘res’]

assets.srcDirs = [‘assets’]

}

// Move the tests to tests/java, tests/res, etc…

instrumentTest.setRoot(‘tests’)

}

}

Can any one give some suggestion?@

What’s line 19 of your build.gradle? That’s the line causing problems. Try to run, as suggested by gradle, gradle with --stacktrace --info and/or --debug.

Thanks for your answering.

I also tried below one by following the official suggestion.(Smack 4.1 Readme and Upgrade Guide · igniterealtime/Smack Wiki · GitHub)

dependencies {

compile “org.igniterealtime.smack:smack-android:4.1.0”

compile “org.igniterealtime.smack:smack-tcp:4.1.0”

}

But, still got below error message:

Finally, i tried to use android studio. I succeeded to include the smack library. But, still can use it in eclipse.

I will try to use android studio to upgrade my project.