安卓 O | API 级别 26 或 27

标签 android android-8.0-oreo android-8.1-oreo

我正在转向 Android O,下面是我的配置:

compileSdkVersion 26
buildToolsVersion 26.0.0
targetSdkVersion 26
com.android.support:appcompat-v7: 27.1.1
com.android.support:support-v4: 27.1.1
com.android.support:recyclerview-v7: 27.1.1
com.android.support:design: 27.1.1
com.android.support:support-annotations: 27.1.1

Q1 根据 Android 指南:

In the second half of 2018, Play will require that new apps and app updates target a recent Android API level.

最近的 Android API 版本是 27 (8.1),但在我的例子中,compileSdkVersion 26、buildToolsVersion 26.0.0、targetSdkVersion 26。所以根据指南,我应该保留 26 还是 27?

Q2 如果我继续使用 compileSdkVersion 26、buildToolsVersion 26.0.0、targetSdkVersion 26 会怎样?这是违反准则还是没关系?

Q3 支持库版本保持27.1.1,compileSdkVersion 26,buildToolsVersion 26.0.0,targetSdkVersion 26可以吗?这个组合有问题吗?

最佳答案

below is my configuration:

您应该在 Android Studio 中收到有关 targetSdkVersioncompileSdkVersion 低于您尝试使用的支持库的主要版本的投诉。

So as per guideline, should I keep 26 or 27?

我们无法确定 Google 需要什么。我建议将您的 compileSdkVersiontargetSdkVersion 移动到 27。

Is it fine if I keep support library version as 27.1.1 and compileSdkVersion 26, buildToolsVersion 26.0.0, targetSdkVersion 26? Is there something wrong with this combination?

很少有理由人为地降低您的buildToolsVersion。而且,如上所述,鉴于您的值(value)观组合,您应该会收到投诉(并且可能会出现构建错误)。我建议将您的 compileSdkVersiontargetSdkVersion 移动到 27,并将您的 buildToolsVersion 设置为最新的(27.0.3 IIRC ).

关于安卓 O | API 级别 26 或 27,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50030267/

相关文章:

java - 如何在android中的多行EditText中设置文本或将文本添加到特定行?

android - Android 中的全局触摸手势?

android - 在 Android Studio Chipmunk 2021.2.1 补丁 1 中构建新项目失败

push-notification - 通知分组在 Android 8.1 中不起作用

android - Oreo (8.1) 上的 toast 重叠问题

java - 在 Activity 之间同时发送数据,同时数据不断更新

java - Android 应用程序在 Android 8.0 (Google Pixel XL) 上崩溃

android 使用 START_STICKY 启动前台服务

android - Apk 未通过 CTS 测试 : shouldNotFIndUnexpectedIntents, 不知道为什么

java - BroadcastReceiver 在 Android 8.1+ 上无法捕获通话事件