Instant App, What's the actual minimum sdk

2019-02-10 20:39发布

As per the android developers site, minimum sdk for Instant app is 21, ie 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.

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.

And does not allow me to create a support for 5.0.

as shown in below image which I tried :

enter image description here

3条回答
劳资没心,怎么记你
2楼-- · 2019-02-10 21:10

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

Please follow this link https://developer.android.com/topic/instant-apps/getting-started/first-instant-app.html

查看更多
等我变得足够好
3楼-- · 2019-02-10 21:16

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.

The documentation is correct about supported Android versions, but note that even that doesn't dictate any particular 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+.

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. I checked tonight and confirmed that the check is still present in 3.0. Could be fixed in a more recent version. But if not, we need to fix that. I'll follow up.

查看更多
再贱就再见
4楼-- · 2019-02-10 21:25

That requirement might be due to android run-time permission support Requesting Permissions at Run Time as official document mention

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. 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.

Currently it has been fixed with android studio 3.1 Canary 5

android studio 3.1 Canary 5 welcome screen android studio 3.1 Canary 5 create project step

查看更多
登录 后发表回答