compile "com.android.support:appcompat-v7:23.0.1" 有什么用?

What is compile "com.android.support:appcompat-v7:23.0.1" used for?

我正在尝试 android / gradle 构建。看到这一行是一些例子

compile "com.android.support:appcompat-v7:23.0.1"

不完全确定这是什么。我的项目目标是 api 26,minSdkVersion 是 23。

我什么时候会使用 appcompat,在我的情况下我需要使用 23 还是 26?

AppCompat 是一组支持库,可用于使使用较新版本开发的应用程序与旧版本一起使用versions.In您的案例 AppCompat 支持版本 23

我的建议是像这样设计你的 gradle:

ext {
    supportLibVersion = '27.0.1' //this should be the latest published version
}

compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:palette-v7:${supportLibVersion}"
compile "com.android.support:customtabs:${supportLibVersion}"
compile "com.android.support:gridlayout-v7:${supportLibVersion}"