powered by Jive Software

Smack 4.3.4 causing gradle project sync to fail in Android Studio


#1

Smack 4.3.4

Gradle project sync keeps failing:

Dependency failing: org.igniterealtime.smack:smack-resolver-minidns:4.3.4 -> org.jxmpp:jxmpp-util-cache@[0.6, 0.6.999], 
but jxmpp-util-cache version was 0.6.3.

Please advise.

Here’s the full text:

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[0.6, 
0.6.999]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: org.igniterealtime.smack:smack-resolver-minidns:4.3.4 -> org.jxmpp:jxmpp-util-cache@[0.6, 0.6.999], 
but jxmpp-util-cache version was 0.6.3.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto org.igniterealtime.smack:smack-android@4.3.4
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@{strictly 4.3.4}
-- Project 'app' depends onto org.igniterealtime.smack:smack-resolver-minidns@{strictly 4.3.4}
-- Project 'app' depends onto org.jxmpp:jxmpp-core@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-util-cache@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-jid@{strictly 0.6.3}
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@4.3.4
-- Project 'app' depends onto org.igniterealtime.smack:smack-android@{strictly 4.3.4}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.

#2

I’m having the same issue


#3

Could you post the respective parts of your build.gradle file?
Especially the dependency section would be interesting.

For me, Smack 4.3.4 is working on Android.


#4
implementation 'org.igniterealtime.smack:smack-tcp:4.3.1'
implementation 'org.igniterealtime.smack:smack-experimental:4.3.1'
implementation 'org.igniterealtime.smack:smack-android:4.3.1'

The above works but as soon as I change the 4.3.1 to 4.3.4 I get the dependency error. I’ve migrated to AndroidX.


#5

Please note the current (working) Smack version is 4.3.2.
It will fail if I change it to 4.3.4.

I’ve removed certain application-specific lines from the file.

Top-level build-gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        mavenCentral()
        google()
        jcenter()

        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'

        classpath 'io.fabric.tools:gradle:1.29.0'
    }
}

allprojects {
    repositories {
        google() // Google's Maven repository
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
        jcenter()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'io.fabric'

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        checkReleaseBuilds false
        ignoreWarnings true
    }

    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {

        renderscriptTargetApi 17

        minSdkVersion 17
        targetSdkVersion 28
        versionCode 35
        versionName "0.2.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true

        resConfigs "en"
   }

    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            shrinkResources false

        }

        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

ext {
    smackVersion = '4.3.2'

    glideVersion = '4.9.0'

    lifecycle_version = '2.0.0'

    supportLibVersion = '28.0.0'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    testImplementation 'junit:junit:4.12'
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:${lifecycle_version}"

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation "com.android.support:design:${supportLibVersion}"

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'

    implementation 'com.google.android.material:material:1.0.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation "com.github.bumptech.glide:glide:${glideVersion}"
    annotationProcessor "com.github.bumptech.glide:compiler:${glideVersion}"

    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9') {
        transitive = true
    }

    implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.9'

    implementation "org.igniterealtime.smack:smack-tcp:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-experimental:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-android:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-android-extensions:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-im:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-core:${smackVersion}"

    implementation "android.arch.work:work-runtime:1.0.1"

    implementation "com.android.support:support-emoji-appcompat:${supportLibVersion}"
    implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.15'

    implementation "androidx.lifecycle:lifecycle-extensions:${lifecycle_version}"
    implementation 'org.jetbrains:annotations-java5:15.0'

    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'

    implementation 'com.google.android.exoplayer:exoplayer:2.9.6'

    implementation 'com.chibde:audiovisualizer:2.1.0'

    implementation 'com.isseiaoki:simplecropview:1.1.8'

    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha06'

    implementation 'com.github.esafirm.android-image-picker:imagepicker:2.0.0'

    implementation "me.leolin:ShortcutBadger:1.1.22@aar"
}

apply plugin: 'com.google.gms.google-services'

proguard-rules.pro

-ignorewarnings

# Keep Glide stuff
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

-dontwarn com.bumptech.glide.**

#6

Paul and me are unable to reproduce this. That said there has been a change in how certain Smack dependencies are declared by Smack.

If I had the full source code or at least a minimal example which is able to reproduce this, then Ic could debug this further.

Which Gradle version are you using? Have you tried the latest?


#7

I am using Gradle version 5.1.1, with Gradle plugin version 3.4.1.
image

There’s nothing newer according to Android Gradle plugin release notes

Does using Java 1.8 have anything to do with this problem?

Please advise.

Many thanks in advance.


#8

Gradle 5.4.1 is the latest version. You should try it and report back if it solves the issue.


#9

I’ve switched to Gradle 5.4.1:
image

Unfortunately, synchronisation with Smack 4.3.4 (or 4.3.3, for that matter) did not succeed with that either:

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[0.6, 
0.6.999]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: org.igniterealtime.smack:smack-resolver-minidns:4.3.4 -> org.jxmpp:jxmpp-util-cache@[0.6, 0.6.999], 
but jxmpp-util-cache version was 0.6.3.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto org.igniterealtime.smack:smack-android@4.3.4
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@{strictly 4.3.4}
-- Project 'app' depends onto org.igniterealtime.smack:smack-resolver-minidns@{strictly 4.3.4}
-- Project 'app' depends onto org.jxmpp:jxmpp-core@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-util-cache@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-jid@{strictly 0.6.3}
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@4.3.4
-- Project 'app' depends onto org.igniterealtime.smack:smack-android@{strictly 4.3.4}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.

A shot in the dark: does the version of JDK and OS matter?
image

image


#10

Could you remove that dependency declaration and report back if this fixes the issue? smack-android is a dependency of smack-android-extensions and thus for not need to be delcared explecitly. Some goes for smack-core.


#11

Gradle synchronisation successful. :grinning:

Happened before I read what you wanted

remove that dependency declaration

My apologies.

I upgraded every item as per Android Studio’s Suggestions

Many items are now alpha or beta, including smack 4.4.0-alpha1. :wink:

Hopefully this will benefit others, too.

Many thanks.

What’s in build.gradle now:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
        jcenter()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'io.fabric'

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        checkReleaseBuilds false
        ignoreWarnings true
    }

    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        renderscriptTargetApi 17

        minSdkVersion 17
        targetSdkVersion 28
        versionCode 35
        versionName "0.2.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true

        resConfigs "en"
    }

    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            shrinkResources false

        }

        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    flavorDimensions "client"
}

ext {
    smackVersion = '4.4.0-alpha1'

    // glideVersion = '4.3.1'
    glideVersion = '4.9.0'

    lifecycle_version = '2.2.0-alpha01'

    supportLibVersion = '28.0.0'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    testImplementation 'junit:junit:4.13-beta-3'
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:${lifecycle_version}"

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation "com.android.support:design:${supportLibVersion}"

    implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'

    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'

    implementation 'com.google.android.material:material:1.1.0-alpha07'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation "com.github.bumptech.glide:glide:${glideVersion}"
    annotationProcessor "com.github.bumptech.glide:compiler:${glideVersion}"

    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1') {
        transitive = true
    }

    // FirebaseUI for Firebase Auth
    implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.9'

    implementation "org.igniterealtime.smack:smack-tcp:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-experimental:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-android-extensions:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-im:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-core:${smackVersion}"

    implementation "android.arch.work:work-runtime:1.0.1"

    implementation "com.android.support:support-emoji-appcompat:${supportLibVersion}"
    implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.13'

    implementation "androidx.lifecycle:lifecycle-extensions:${lifecycle_version}"
    implementation 'org.jetbrains:annotations-java5:15.0'

    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'

    implementation 'com.google.android.exoplayer:exoplayer:2.9.6'

    implementation 'com.chibde:audiovisualizer:2.1.0'

    implementation 'com.isseiaoki:simplecropview:1.1.8'

    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha06'

    implementation 'com.github.esafirm.android-image-picker:imagepicker:2.0.0'

    implementation "me.leolin:ShortcutBadger:1.1.22@aar"
}

apply plugin: 'com.google.gms.google-services'

#12

I would not recommend using a Smack alpha. It is very likely that you will run into the issue with the next alpha.


#13

Understood. 4.3.4 it is.

Thanks.


#14

Smack 4.3.4 is causing gradle synchronisation error.

Summary:

  • 4.3.2 syncs OK.
  • 4.3.3 fails.
  • 4.3.4 fails.
  • 4.4.0-alpha1 syncs OK.
ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[0.6, 0.6.999]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: org.igniterealtime.smack:smack-resolver-minidns:4.3.4 -> org.jxmpp:jxmpp-util-cache@[0.6, 0.6.999], but jxmpp-util-cache version was 0.6.3.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue.
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@{strictly 4.3.4}
-- Project 'app' depends onto org.igniterealtime.smack:smack-resolver-minidns@{strictly 4.3.4}
-- Project 'app' depends onto org.jxmpp:jxmpp-core@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-util-cache@{strictly 0.6.3}
-- Project 'app' depends onto org.jxmpp:jxmpp-jid@{strictly 0.6.3}
-- Project 'app' depends onto org.igniterealtime.smack:smack-android-extensions@4.3.4
-- Project 'app' depends onto org.igniterealtime.smack:smack-android@{strictly 4.3.4}

For extended debugging info execute Gradle from the command line with /gradlew --info :app:assembleDebug to see the dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file.

#15

Did you remove the dependency declarations as I asked you too?


#16

Yes.

implementation "org.igniterealtime.smack:smack-tcp:${smackVersion}"
implementation "org.igniterealtime.smack:smack-experimental:${smackVersion}"
implementation "org.igniterealtime.smack:smack-android-extensions:${smackVersion}"
implementation "org.igniterealtime.smack:smack-im:${smackVersion}"
implementation "org.igniterealtime.smack:smack-core:${smackVersion}"

#17

And? Does it change anything?

You can also remove smack-core.


#18

Removed smack-core.
Still the same error.

    implementation "org.igniterealtime.smack:smack-tcp:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-experimental:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-android-extensions:${smackVersion}"
    implementation "org.igniterealtime.smack:smack-im:${smackVersion}"

#19

Could you please always show the complete output. It may look similar but maybe we can spot an difference.

That said, since we are unable to reproduce this, all that is left I can do is to ask you to present a minimal example which exhibits the behavior.