0

I am developing the instant app of my main app and I am confused about the targetsandbox version of the instant app and installed app. When I try to upgrade from instant app to installed app from android studio I am getting the following error New target sandbox version 1 is incompatible with the previous version of 2.

When I set the targetsandbox version to 2 in my installed app, the app crashes immediately.

I reviewed following posts Question 1 and Question 2 but its not helping.

Thanks

Ezio
  • 2,837
  • 2
  • 29
  • 45
  • Target sandbox could be either version 1 or 2 for installed app, for instant app that targets Android API level 26 & up, this attribute must be set to 2 (refer to https://developer.android.com/guide/topics/manifest/manifest-element#targetSandboxVersion). I also get "New target sandbox version 1 is incompatible..." error when I run app locally from Android Studio on O+ devices, but this is not an issue in production. For local testing you need to remove instant app from device before running installed app. – Julia K Jan 25 '19 at 22:53
  • @JuliaK But if I dont set the target sdk version to 2 in my installed app, will I be able to retain the data that is set in my instant app to my installed app. It is important for my use case but the docs clearly says that we can't. – Ezio Jan 26 '19 at 01:38
  • You can use Instant App Cookie API for data transfer from instant to installed app. An advantage of this API over Storage API is that it doesn’t require you to set “targetSandboxVersion=2” in installed app. You can take a look at Cookie API sample at https://github.com/googlesamples/android-instant-apps/tree/master/cookie-api – Julia K Jan 28 '19 at 18:38
  • Is there a limitation on the amount of data that we can store in cookies API? The reason I am asking is that I can see there is a max cookie size API. Is there a possibility for the API to fail if the maximum size is reached. – Ezio Jan 29 '19 at 12:43

0 Answers0