Android _ Failed to allow import of android.support.v7.graphics?

I add appcompat_v7 to the project but cannot import :

 import android.support.v7.graphics.Palette; 

What can I do?

I see my android-support-v7-appcompat.jar in this jar package android-support-v7.appcompat empty. How can i get sub classes ?

+7
android android-library
source share
3 answers

Add android-support-v7-palette.jar to the project and add it to the build path.

+5
source share

use this in your gradle

 compile 'com.android.support:palette-v7:22.2.0' 
+15
source share

make sure you use the version in compileSdkVersion

For example, for:

 compileSdkVersion 22 

you are using:

compile 'com.android.support:palette-v7:22.x.x'

+1
source share

All Articles