如何在Android项目中使用gradle依赖项

时间:2014-08-26 11:53:50

标签: android gradle android-gradle

我正在尝试在我的Android项目中使用库org.json:json:20131018,但当我将其作为gradle依赖项添加时,我得到:

WARNING: Dependency org.json:json:20131018 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

WARNING: Dependency org.json:json:20131018 is ignored for release 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

/Users/jim/dev/myapplication-android/myapplication-api/src/main/java/net
/myapplication/android/api/some/package/MyClass.java:18: 
error: cannot find symbol
        return XML.toJSONObject(xml).toString();
               ^
   symbol:   variable XML
   location: class MyClass

我需要此库中的XML类,并且Android org.json包没有此内容。

如果我排除了依赖项,那么我仍然会收到此错误:

/Users/jim/dev/myapplication-android/myapplication-api/src/main/java/net
/myapplication/android/api/some/package/MyClass.java:18: 
error: cannot find symbol
        return XML.toJSONObject(xml).toString();
               ^
   symbol:   variable XML
   location: class MyClass

所以我需要能够包含这个库。

0 个答案:

没有答案