Can not build smack 4.2.0 source codes

@

I downloaded smack 4.2.0 source, and want to add new functions for it.

But I can not build it, and always get such error.

  • Where:

Build file ‘/Users/snowingximen/ws_android/Smack-4.2.0/smack-android/build.gradle’ line: 15

  • What went wrong:

A problem occurred evaluating project ‘:smack-android’.

Cannot change dependencies of configuration ‘:smack-android:compile’ after it has been included in dependency resolution.

  • Try:

Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

BUILD FAILED

Do you have the Android SDK installed?

Yes, my /etc/profile is as below:

export ANDROID_HOME=/apps/tools/android-sdk-macosx

export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin:$GRADLE_HOME/bin:$ANDROID_HOME/platform- tools:$ANDROID_HOME/tools

But IDE always report error: can not find ANDROID_HOME. I hard code the varaible androidHomeEnv in build.gradle:

def getAndroidHome() {

def androidHomeEnv = “/apps/tools/android-sdk-macosx”

It works, but report error as mentioned above.

Afaik you need Android build tools of api level 9. Maybe that helps.

Otherwise try executing with --debug to get more information.

It needs android level 9?

Actually, I only installed android 23, 25.

It appears that you are trying to build a release version of Smack with Gradle 3 (or any higher version of Gradle)