天天看点

android.support.v7.widget.jar,java - 如何解决“错误:程序包android.support.v7.widget不存在”的问题? - 堆栈内存溢出...

我想向我的应用添加操作栏。 而且出现了一个问题

error: package android.support.v7.widget does not exist 。

无论我如何尝试,我都无法解决该问题。 互联网上的任何解决方案都不适用于我。我不知道为什么会这样,我真的很累了。 我是初学者,这个问题使我发疯。我试图改变

android.useAndroidX=true >设置为false

android.enableJetifier=true true-> gradle.properties为false

是的,它的工作!但是这里出现了另一个问题:

java.lang.RuntimeException: Manifest merger failed : Attribute [email protected] 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,但无法正常工作。