Android _ import android.support.v7.graphics 无法解析?

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

我在我的项目中添加 appcompat_v7 但我不能 import :

import android.support.v7.graphics.Palette;

我能做什么?

我在这个 jar 中看到我的 android-support-v7-appcompat.jar 包裹 android-support-v7.appcompat 是 empty.How 我可以得到子 classes ?

将 android-support-v7-palette.jar 添加到您的项目并将其添加到构建路径。

或将依赖添加到应用gradle文件(最新版本)

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

在您的 gradle

中使用它
implementation 'com.android.support:palette-v7:22.2.0'

确保您使用的版本在 compileSdkVersion

例如:

compileSdkVersion 22

您使用:

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

V26.0.2 是图形的一个错误,使用这些升级的依赖项:

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'