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'
}
I'm getting
Error:Android Gradle Build Target: java.lang.NullPointerException
When removing com.android.support:design:22.2.0
(and adding back v4
and AppCompat
), build is successful.
Another similar issue didn't help me
Notice that i'm building using Intellij 14
I ran the
app
usingandroid studio
and notIntelliJ 14
and got a different error:So if someone is running
IntelliJ 14
, until next update ofIntellij 14
I guess It's safer to useandroid studio 1.3.+
(or at least check for errors usingandroid studio
.If one get the same error.
go to attr.xml and remove
declare-styleable name="ScrimInsetsView"
using ctrl-shift-f search for
insetF
and removeapp:insetForeground
attribute from all the layout that contains such attribute.Everything should work OK now
I had exactly the same issue. I guess it comes from an combination of mismatching parameters in grade and your xml resources.. Maybe this will help (for me it did):
Give the build.grade the 1.1.1, too (just in case)
Hopefully the next sync, clean and rebuild will pass (or fire a meaningful error message like 'color-res blabla not found').
Btw: From time to time my IntelliJ is setting itself to other Java-configs (e.g. Java8 with lambdas) - so "just in case": Don't forget to check if your project SDK is set up correctly (File > Project-structure > project > choose the SDK).