【问题标题】:Android _ The import android.support.v7.graphics cannot be resolved?Android_导入android.support.v7.graphics无法解决?
【发布时间】:2015-03-10 09:53:52
【问题描述】:

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

import android.support.v7.graphics.Palette;

我能做什么?

我在这个jar 中看到我的android-support-v7-appcompat.jarandroid-support-v7.appcompat 是空的。我怎样才能得到子classes

【问题讨论】:

  • 你是添加了jar文件还是整个项目?
  • 我添加了所有项目。
  • 您需要单独导入Palette lib并添加到您项目的构建路径中。
  • 如何获得Palette lib
  • 在您的 sdk\extras\android\support\v7 文件夹中。 @JIM

标签: android android-library


【解决方案1】:

在你的 gradle 中使用它

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

【讨论】:

    【解决方案2】:

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

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

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

    【讨论】:

      【解决方案3】:

      确保您使用 compileSdkVersion

      中的版本

      例如:

      compileSdkVersion 22
      

      你使用:

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

      【讨论】:

        【解决方案4】:

        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'
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-03-08
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-09-19
          • 1970-01-01
          相关资源
          最近更新 更多