我在运行Android工作室时出错。
警告:在调试时,依赖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时
android工作室在没有警告的情况下运行。
请告诉我哪里出了问题,
谢谢。
发布于 2017-02-22 06:44:24
再试一次。它一定会起作用的.
通过在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'
}这对我有用:不再有任何警告了:)
https://stackoverflow.com/questions/33497347
复制相似问题