我想在我的应用中添加一个操作栏。而且出现问题
错误:android.support.v7.widget 包不存在
。
无论我怎样尝试都无法解决这个问题。互联网上的任何解决方案对我都不起作用。我不知道为什么会这样,我真的厌倦了。我是初学者,这个问题让我发疯。我已经尝试改变
android.useAndroidX=true
--> 为 false
和
android.enableJetifier=true
--> gradle.properties 为 false
是的,它的工作!但这里出现了另一个问题:
java.lang.RuntimeException: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
这是我的build.gradle:
compileSdkVersion 29
buildToolsVersion '29.0.1'
minSdkVersion 21
targetSdkVersion 29
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'com.google.android.material:material:1.1.0-alpha07'
testİmplementation 'junit:junit:4.13-beta-3'
androidTestİmplementation 'androidx.test:runner:1.3.0-alpha01'
androidTestİmplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
}
可能是实现方法上的问题,我不知道。可能是我在 SDK 版本上有问题。我已经尝试迁移到 AndroidX 但没有成功。
最佳答案
尝试替换
android.support.v7.widget
与
androidx.appcompat.widget
关于java - 如何修复 "error: package android.support.v7.widget does not exist"问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57033536/