我正在尝试将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)时,构建成功。

Another similar issue对我没有帮助

请注意,我正在使用进行构建Intellij 14

最佳答案

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

`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属性。

  • 现在一切正常

    07-24 09:49
    查看更多