简体   繁体   English

即时应用程序,实际最小sdk是多少

[英]Instant App, What's the actual minimum sdk

As per the android developers site, minimum sdk for Instant app is 21, ie 5.0. 根据Android开发者网站,Instant app的最小sdk为21,即5.0。 link 链接

The site clearly states : Android Instant Apps are available on the majority of devices running Android 5.0 (API level 21) and higher. 该网站明确指出:Android Instant Apps适用于运行Android 5.0(API级别21)及更高版本的大多数设备。

But when we create a new project as per the guideline given in this link which states that we need to have minimum sdk of 23, to get instant app support. 但是当我们根据此链接中给出的指南创建一个新项目时,我们需要最小的sdk为23,以获得即时应用程序支持。

And does not allow me to create a support for 5.0. 并且不允许我为5.0创建支持。

as shown in below image which I tried : 如下图所示:

在此输入图像描述

That requirement exists only in the setup wizard, and it is a bug. 该要求仅存在于设置向导中,这是一个错误。 If you change the value to something lower after creating the project, you'll see that it builds fine and can run on API 21 and 22 devices. 如果在创建项目后将值更改为更低的值,您将看到它构建正常并可以在API 21和22设备上运行。

The documentation is correct about supported Android versions, but note that even that doesn't dictate any particular minSdkVersion. 关于支持的Android版本的文档是正确的,但请注意,即使这样也没有规定任何特定的minSdkVersion。 You can build an instant app with a minSdkVersion lower than 21. It just won't run on anything before 21, since the Instant Apps Runtime itself is restricted to 21+. 您可以使用低于21的minSdkVersion构建即时应用程序。由于Instant Apps Runtime本身限制为21+,因此它不会在21之前的任何内容上运行。

For that reason, this check was always a bug, even when we didn't support devices before 23. I was told it was fixed in 3.0, though I didn't verify. 出于这个原因,这个检查总是一个错误,即使我们在23之前不支持设备。我被告知它已在3.0中修复,但我没有验证。 I checked tonight and confirmed that the check is still present in 3.0. 我今晚检查并确认支票仍然存在于3.0。 Could be fixed in a more recent version. 可以在更新版本中修复。 But if not, we need to fix that. 但如果没有,我们需要解决这个问题。 I'll follow up. 我会跟进。

That requirement might be due to android run-time permission support Requesting Permissions at Run Time as official document mention 该要求可能是由于Android运行时权限支持在运行时请求权限作为官方文档提及

Note: Beginning with Android 6.0 (API level 23), users can revoke permissions from any app at any time, even if the app targets a lower API level. 注意:从Android 6.0(API级别23)开始,用户可以随时撤消任何应用的权限,即使应用程序的API级别较低也是如此。 You should test your app to verify that it behaves properly when it's missing a needed permission, regardless of what API level your app targets. 无论您的应用针对什么API级别,您都应该测试您的应用,以验证它在缺少所需权限时是否正常运行。

Currently it has been fixed with android studio 3.1 Canary 5 目前已经修复了android studio 3.1 Canary 5

android studio 3.1 Canary 5欢迎屏幕 android studio 3.1 Canary 5创建项目步骤

For instance app minimum API 23: Android 6.0 (Marshmallow). 例如app app API 23:Android 6.0(Marshmallow)。

Please follow this link https://developer.android.com/topic/instant-apps/getting-started/first-instant-app.html 请点击此链接https://developer.android.com/topic/instant-apps/getting-started/first-instant-app.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM