我在我的项目中添加了appcompat_v7
,但无法导入
:
import android.support.v7.graphics.Palette;
我该怎么办?
我发现我的android-support-v7-appcompat.jar
中,android-support-v7.appcompat
包是空的。我该如何获取子类?
我在我的项目中添加了appcompat_v7
,但无法导入
:
import android.support.v7.graphics.Palette;
我该怎么办?
我发现我的android-support-v7-appcompat.jar
中,android-support-v7.appcompat
包是空的。我该如何获取子类?
在您的Gradle中使用此内容
implementation 'com.android.support:palette-v7:22.2.0'
implementation 'com.android.support:palette-v7:22.2.0'
如果您正在使用 Android X:
implementation 'androidx.palette:palette:1.0.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'