无法在Lollipop以下的系统上运行应用程序。

6
我正在使用Android Studio。我的应用在Lollipop设备上运行良好,但是当我在低于Lollipop的设备上运行应用时,会出现以下错误消息。我也尝试了这个答案。

如果出现问题,请使用jarjar重新打包以更改类包 警告:依赖项xpp3:xpp3:1.1.4c在发布中被忽略,因为它可能与Android提供的内部版本冲突。 如果出现问题,请使用jarjar重新打包以更改类包 警告:依赖项xpp3:xpp3:1.1.4c在调试中被忽略,因为它可能与Android提供的内部版本冲突。

我的build.gradle文件如下:
    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.mypackagename"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.pro'
        }
    }
    }

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:recyclerview-v7:21.0.+'
    compile project(':library')

    compile 'com.loopj.android:android-async-http:1.4.7'
    compile 'com.googlecode.libphonenumber:libphonenumber:7.0.5'
    compile 'com.afollestad:material-dialogs:0.7.4.2'

    //For XMPP
    compile 'org.igniterealtime.smack:smack-android:4.1.0'
    // Optional for XMPPTCPConnection
    compile 'org.igniterealtime.smack:smack-tcp:4.1.0'
    // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
    compile 'org.igniterealtime.smack:smack-im:4.1.0'
    // Optional for XMPP extensions support
    compile 'org.igniterealtime.smack:smack-extensions:4.1.0'

    compile 'com.android.support:multidex:1.0.1'

    /*  compile "org.igniterealtime.smack:smack-android:4.1.0-rc1"
            // Optional for XMPPTCPConnection
            compile "org.igniterealtime.smack:smack-tcp:4.1.0-rc1"
            // Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
            compile "org.igniterealtime.smack:smack-im:4.1.0-rc1"
            // Optional for XMPP extensions support
            compile "org.igniterealtime.smack:smack-extensions:4.1.0-rc1"
            compile "org.igniterealtime.smack:smack-tcp:4.1.0-alpha6"*/

}
1个回答

17

你可以在你的build.gradle文件中添加以下代码。它对我有效:

configurations {
    all*.exclude group: 'xpp3', module: 'xpp3'
}

10倍的感谢,老兄,你救了我! 由于某种原因,在Android中为compile()依赖项添加exclude只对一个依赖项无效,可能是因为它被从测试配置和其他配置中排除了... 这样可以确保它将从所有依赖项中移除。 - codeScriber
@sondt87 这里出了什么问题,你的解决方案是如何解决的? - Chintan Shah

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接