【问题标题】:Warning:Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android警告:依赖 org.json:json:20090211 被忽略以进行调试,因为它可能与 Android 提供的内部版本冲突
【发布时间】:2015-11-03 10:56:47
【问题描述】:

我在运行 Android Studio 时遇到错误。

警告:依赖 org.json:json:20090211 被忽略以进行调试,因为它可能与 Android 提供的内部版本冲突。

我的 build.gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'org.java-websocket:Java-WebSocket:1.3.0'
    compile 'com.github.nkzawa:engine.io-client:0.6.0'
    compile 'com.github.nkzawa:socket.io-client:0.6.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile files('libs/json_simple.jar')
    compile files('libs/pushy-1.0.7.jar')
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
}

我尝试排除 org.json,它不起作用。

exclude group:'org.json',module:'json'

但是当我删除 socket.io-client、engine.io-client 和 facebook sdk

android studio 正在运行,没有警告。

请告诉我哪里出错了,


谢谢。

【问题讨论】:

    标签: android json android-studio gradle android-sdk-tools


    【解决方案1】:

    再试一次。它肯定会起作用。

    您可以通过在 build.gradle 中添加以下行来从模块中排除 json 依赖项

    我从这里改变了

    compile 'com.github.nkzawa:socket.io-client:0.4.1'
    

    compile ('com.github.nkzawa:socket.io-client:0.4.1'){
    exclude group: 'org.json', module: 'json'
    }
    

    这对我有用:不再有警告:)

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 2016-05-20
      • 2015-07-03
      • 2015-11-22
      • 2015-08-25
      • 1970-01-01
      • 1970-01-01
      • 2015-05-10
      • 2016-07-10
      相关资源
      最近更新 更多