android设计库gradle空指针异常

标签 android android-support-library android-design-library

我正在尝试将 android.support.design 库添加到我的项目中:我的 gradle 文件中所有有趣的东西:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:support-annotations:22.0.0'
    compile 'com.android.support:support-v13:22.1.1'
    compile 'com.android.support:recyclerview-v7:22.1.1'
    compile 'com.android.support:cardview-v7:22.1.0'
}

我得到了

Error:Android Gradle Build Target: java.lang.NullPointerException

当删除 com.android.support:design:22.2.0(并添加回 v4AppCompat)时,构建成功。

library version

Another similar issue没有帮助我

请注意,我正在使用 Intellij 14

构建

最佳答案

我使用 android studio 而不是 IntelliJ 14 运行了 app 并得到了一个不同的错误:

`Error:(1) Attribute "insetForeground" has already been defined`

因此,如果有人正在运行 IntelliJ 14,直到 Intellij 14 的下一次更新,我想使用 android studio 1.3.+ 会更安全(或者至少使用 android studio 检查错误。

如果出现同样的错误。

  • 转到 attr.xml 并删除 declare-styleable name="ScrimInsetsView"

  • 使用 ctrl-shift-f 搜索 insetF 并从所有包含该属性的布局中删除 app:insetForeground 属性.

现在一切正常

关于android设计库gradle空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30621242/

相关文章:

android - android支持设计库提供的FAB如何添加阴影?

java - 进行查询以检索每个大陆的国家/地区 Firebase 实时数据库

android - 在 android.support.annotation 中找不到 RequiresApi

android - 如何编译播放服务:11. 2.0

android - java.lang.NoClassDefFoundError : android. support.v7.widget.* 自从升级到支持库 v23

android - 在 TabLayout(Android 设计支持库)中更改 Tab 的背景颜色不会占用整个选项卡空间

Android Bottomsheet TextView 高度在第一次扩展时未调整

android - Kotlin:检查多个 bool 函数的惯用方法

android - 如何禁用绘图缓存?

android - 如何更改android垂直滚动条插入