调试将忽略依赖org.json:json:20090211,因为它可能与Android提供的内部版本冲突

调试将忽略依赖org.json:json:20090211,因为它可能与Android提供的内部版本冲突

问题描述:

当我运行android studio时,会出现以下警告:

While I am running android studio, the warning below appears:


依赖org.json:json:20090211被忽略以进行调试它可能与Android提供的内部版本冲突。
如果出现问题,请使用jarjar重新打包以更改类包

Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage with jarjar to change the class packages

如何解决此错误?

谢谢。

CommonsWare的回答是正确的。调试将忽略依赖org.json:json:20090211,因为它可能与Android提供的内部版本冲突。

CommonsWare answer is correct. Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android.

如果您使用的是gradle依赖,请尝试排除org。包中的json。

If you are using gradle dependency try excluding org.json from the package.

compile ('com.your.dependency.name:0.0.0'){
  exclude group: 'org.json', module: 'json'
}

这一个为我工作。