如何在Android Studio中导入androidx.appcompat.app.AppCompatActivity?

问题描述 投票:0回答:1

我已经设置了android.useAndroidX=trueandroid.enableJetifier=true,我可以看到一些androidx...程序包,但是看不到androidx.appcompat.app

我想我需要在implementation 'androidx.appcompat...:v1.0.0'文件中添加类似build.gradle的内容,但是正确的字符串是什么,或者也许我不需要这个?

Migrate to AndroidX不起作用,因为我不存在带有支持库的项目。我即将使用操作栏和标签(现在已弃用)将Acitivty重写为androidx AppCompatAcvitiy

谢谢。

android androidx
1个回答
0
投票

哦,好的,我在发布问题后就发现了它。

来自https://developer.android.com/jetpack/androidx/releases/appcompat

dependencies {
    def appcompat_version = "1.1.0"

    implementation "androidx.appcompat:appcompat:$appcompat_version"
    // For loading and tinting drawables on older versions of the platform
    implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
}
© www.soinside.com 2019 - 2024. All rights reserved.