user4501847
user4501847

Reputation:

Android _ The import android.support.v7.graphics cannot be resolved?

I add in my project appcompat_v7 but I can't import :

import android.support.v7.graphics.Palette;

What can I do ?

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

Upvotes: 12

Views: 8686

Answers (4)

Pooja
Pooja

Reputation: 2467

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

or add the dependency into the app gradle file (latest version)

implementation 'com.android.support:palette-v7:22.2.0'

And if you are using Android X:

implementation 'androidx.palette:palette:1.0.0'

Upvotes: 7

Mirikwa
Mirikwa

Reputation: 11

make sure that you use a version within the compileSdkVersion

For example for:

compileSdkVersion 22

you use:

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

Upvotes: 1

Vikram
Vikram

Reputation: 201

use this in your gradle

implementation 'com.android.support:palette-v7:22.2.0'

Upvotes: 18

Pradeep Sheoran
Pradeep Sheoran

Reputation: 493

V26.0.2 is a bug for graphics, Use these upgraded dependency :

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
   testImplementation 'junit:junit:4.12'
     compile 'com.android.support:support-v4:27.1.1'

Upvotes: 0

Related Questions