8

I am new to running instant app. I have created a new "Hello World" project with instant app support, according to android developer documents.

But, when running "instantapp", the following error occurs:

enter image description here

I would appreciate it if anyone could help.

mm49307
  • 2,490
  • 2
  • 19
  • 15

1 Answers1

6

Note: There is a known issue running Instant Apps on the emulator image that includes the Google Play Store which will give this same error. For now, please use the emulator without Play Store.

Google Play Services giving statusCode=API_UNAVAILABLE means your device is not able to run Instant Apps for one reason or another. For example, you are not using a supported device or you are not in a launched country. Please see here for a list of supported development devices and here for a list of countries Instant Apps are available in.

The emulator should still work for development and will run outside of any restrictions. For instructions on setting up an emulator for Instant App development see here:

https://developer.android.com/topic/instant-apps/getting-started/setup.html#setup-emulator

AdamK
  • 21,199
  • 5
  • 42
  • 58
  • I've set up the emulator the recommended way(Nexus 5X 6.0, x86 with Google APIs). After starting it I logged in to a google account, but I still can't see the option Settings > Google > Instant Apps. Also, trying to open links that support instant apps like https://www.buzzfeed.com/tasty just open the common webpage. I'm in Brazil, a country not supported yet. Was that supposed to happen? I appreciate any help, thanks. – Mateus Gondim May 24 '17 at 19:44
  • 1
    @MateusGondim You may need to build and deploy once to the emulator using Studio first (which will provision and set up the emulator) before testing other Instant Apps will work (also before you see the option in settings). There might be a way to run the provision task separately but I'm not sure how. – AdamK May 25 '17 at 01:26
  • that seemed to work. Now I see the option in settings and my instant app hello world project worked. I can't get published instant apps to come up though(such as buzzfeed, wish, etc) but I guess that has to do with the fact that play store is not installed. – Mateus Gondim May 27 '17 at 23:08