将库添加到android项目后,XML标记仍然“在Android资源文件中不允许”

时间:2013-07-12 19:51:23

标签: java android xml android-studio androidplot

我一直在尝试将一个名为“Android Plot”的库添加到我的项目中,但是我似乎无法通过此错误。屏幕截图如下。这个库已经用于我以前做过的其他测试项目。

我正在使用Android Studio。关于如何通过这个的建议会很棒。感谢

The file tree showing that the library is added

high lighted xml code that doesn't work

Project structure showing that the library is used

1 个答案:

答案 0 :(得分:3)

想出来。 AndroidStudio仍处于“贫民窟”阶段,因此如果您尝试以典型的IntelliJ方式添加库依赖项,您会收到警告,告诉您无论您在项目/模块对话框中执行的操作(在您选择它时显示)实际上都没有对您的构建产生影响,您必须手动编辑build.gradle。

在Androidplot 0.5.2的情况下,你会做什么:

  1. 将androidplot-core-0.5.2.jar添加到/ libs目录
  2. 在构建的依赖项部分。 gradle add:

    编译文件('libs / androidplot-core-0.5.2.jar')

  3. 一旦你完成了这个,你应该没事。

    尼克