Android的设计库gradle这个空指针异常 [英] android design library gradle null pointer exception

查看:360
本文介绍了Android的设计库gradle这个空指针异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图 android.support.design 库添加到我的项目:所有有趣的事情在我的文件的gradle:

I'm trying to add android.support.design library to my project: All the interesting things in my gradle file:

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 (,并重新添加 V4 程序兼容性),打造成功。

When removing com.android.support:design:22.2.0 (and adding back v4 and AppCompat), build is successful.

<一个href=\"http://stackoverflow.com/questions/30541403/gradle-error-after-add-android-support-design-library\">Another类似的问题没有帮助我

请注意,我使用建的IntelliJ 14

推荐答案

我跑了应用使用 Android的工作室而不是 14的IntelliJ ,并得到了不同的错误:

I ran the app using android studio and not IntelliJ 14 and got a different error:

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

因此​​,如果有人正在运行的IntelliJ 14 ,直到的IntelliJ 14 我想这是使用更安全的下一次更新 Android的工作室1.3 + (或至少检查使用错误 Android的工作室

So if someone is running IntelliJ 14, until next update of Intellij 14 I guess It's safer to use android studio 1.3.+ (or at least check for errors using android studio.

如果一个人得到同样的错误。

If one get the same error.


  • 去attr.xml并删除申报,设置样式名称=ScrimInsetsView

使用的 CTRL-Shift-F组合的搜索 insetF 和删除应用:insetForeground 属性从包含这样的属性,所有的布局。

using ctrl-shift-f search for insetF and remove app:insetForeground attribute from all the layout that contains such attribute.

一切都应该工作,现在好了

Everything should work OK now

这篇关于Android的设计库gradle这个空指针异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆