代码之家  ›  专栏  ›  技术社区  ›  Dr Deo

无法在android上使用igniterealtime smack无法解析xpp3:xpp3:1.1.4c

  •  0
  • Dr Deo  · 技术社区  · 7 年前

    我没有使用 smack jabber
    应用程序gradle

    实现“org.igniterealtime.smack:smackandroid:4.3.1”
    实现“org.igniterealtime.smack:smack tcp:4.3.1”

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.minidns:minidns-client:0.3.3.
    
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve xpp3:xpp3:1.1.4c.
    
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.jxmpp:jxmpp-core:0.6.3.
    
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.jxmpp:jxmpp-jid:0.6.3.
    
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.minidns:minidns-core:0.3.3.
    
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.minidns:minidns-hla:0.3.3.
    

    这是我的毕业档案

    应用程序gradle

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 26
        defaultConfig {
            applicationId "ug.situla.passengermvp"
            minSdkVersion 15
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:26.1.0'
        implementation 'com.android.support:cardview-v7:26.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        testImplementation 'junit:junit:4.12'
        implementation 'com.google.android.gms:play-services-places:16.0.0'
        implementation 'com.google.android.gms:play-services-maps:16.0.0'
        implementation 'com.google.maps.android:android-maps-utils:0.5'
        implementation "org.igniterealtime.smack:smack-java7:4.3.1"
        implementation "org.igniterealtime.smack:smack-android:4.3.1"
        implementation "org.igniterealtime.smack:smack-tcp:4.3.1"
        //implementation "org.igniterealtime.smack:smack-android:4.2.0"
        //implementation "org.igniterealtime.smack:smack-tcp:4.2.0"
        //implementation "org.igniterealtime.smack:smack-im:4.2.0"
        //implementation "org.igniterealtime.smack:smack-extensions:4.2.0"
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    }
    
    configurations {
        all*.exclude group: 'xpp3', module: 'xpp3'
    }
    

    构建.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
    
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            //maven {url 'http://localhost:8081/repository/google/'}
            //maven {url 'http://localhost:8081/repository/jcenter/'}
            google()
            jcenter()
            maven {
                url 'https://oss.sonatype.org/content/repositories/snapshots'
            }
            mavenCentral()
            //google()
            //jcenter()
         }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   MatPag    7 年前

    确保在你的项目中 build.gradle 您有:

    buildscript {
        repositories {
            google()
            jcenter()
            maven {
                url 'https://oss.sonatype.org/content/repositories/snapshots'
            }
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven {
                url 'https://oss.sonatype.org/content/repositories/snapshots'
            }
            mavenCentral()
        }
    }
    

    构建.gradle

    dependencies {
       implementation "org.igniterealtime.smack:smack-java7:4.3.0"
       implementation "org.igniterealtime.smack:smack-android:4.3.0"
       implementation "org.igniterealtime.smack:smack-tcp:4.3.0"
    }
    configurations {
        all*.exclude group: 'xpp3', module: 'xpp3'
    }
    

    https://github.com/igniterealtime/Smack/wiki/Smack-4.3-Readme-and-Upgrade-Guide

    推荐文章