3

Unable to use Android Emulator, for testing the Instant Apps!! Every-time I'm getting "Side loading instant app failed: Reading bundle timed out."


I'm using, Android Studio 3.0 Canary-5

Emulator: Nexus 5X image running Android 6.0 (API level 23), x86, with Google APIs. Google APIs Intel x86 Atom System Image (Revision 21)

Note: After updating Android Studio 3.0 (Canary-4 > Canary-5) & Emulator system image from revision (20 > 21). I'm unable to run the instant App through emulator. Always I'm getting the error message saying "Side loading instant app failed: Reading bundle timed out."

com.google.android.gms.persistent E/InstantApps: DomainFilterImpl: Error while reading domain filter from WHAPI
                                                                              java.util.concurrent.ExecutionException: awjr: INVALID_ARGUMENT: Application credential header not valid. Please fix the client to pass a valid application credential header.
                                                                                  at java.util.concurrent.FutureTask.report(FutureTask.java:94)
                                                                                  at java.util.concurrent.FutureTask.get(FutureTask.java:164)
                                                                                  at tey.get(:com.google.android.gms:1)
                                                                                  at tir.a(:com.google.android.gms:25)
                                                                                  at tir.a(:com.google.android.gms:16)
                                                                                  at tir.a(:com.google.android.gms:9)
                                                                                  at tir.b(:com.google.android.gms:0)
                                                                                  at tio.b(:com.google.android.gms:0)
                                                                                  at com.google.android.gms.instantapps.routing.DomainFilterUpdateChimeraService.a(:com.google.android.gms:14)
                                                                                  at tiu.run(:com.google.android.gms:0)
                                                                                  at lhb.run(:com.google.android.gms:24)
                                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                  at lmc.run(:com.google.android.gms:0)
                                                                                  at java.lang.Thread.run(Thread.java:818)
                                                                               Caused by: awjr: INVALID_ARGUMENT: Application credential header not valid. Please fix the client to pass a valid application credential header.
                                                                                  at awjn.c(:com.google.android.gms:0)
                                                                                  at lbb.a(:com.google.android.gms:97)
                                                                                  at tem.b(:com.google.android.gms:43)
                                                                                  at tem.a(:com.google.android.gms:0)
                                                                                  at tez.call(:com.google.android.gms:1)
                                                                                  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                  at lhb.run(:com.google.android.gms:24) 
                                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
                                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
                                                                                  at lmc.run(:com.google.android.gms:0) 
                                                                                  at java.lang.Thread.run(Thread.java:818) 

    W/ActivityManager: Unable to start service Intent { act=com.google.android.instantapps.devman.iapk.LOAD cmp=com.google.android.instantapps.devman/.iapk.IapkLoadService (has extras) } U=0: not found

Appreciate your help.


Update:

Found solution in Android studio release notes here. This is a known-issue under Android Studio canary-5.

Reliability issue with instant app provisioning cache. If you manually unprovision your device or emulator image for instant app development, and then deploy the instant app from Android Studio, the deployment will fail because Android Studio will not provision your device/emulator image again. To workaround for this issue: Go into the Run Configuration dialog and select the instantapp module on the left-hand pane. Click the “Instant App Provision” task under “Before launch:Gradle-aware Make, Instant App Provision” Click the edit (the pencil icon) Check “Clear provisioned devices cache”

Karthi R
  • 1,338
  • 10
  • 25
  • The error says ` Application credential header not valid.`, have you tried to check this credential and fix it? – Akram Jul 04 '17 at 14:12
  • Same code was working, before updating the Android studio and Emulator system image. So I don't think problem with code – Karthi R Jul 04 '17 at 14:25

4 Answers4

3

The device is being considered as "already provisioned for instant apps" but it's not, probably because another device with the same serial number (same emulator) was used before and modified or because the device was modified externally (not by Android Studio).

A workaround for that is to clear the cache before each run: InstantApp run configuration -> before run tasks -> provision for instant app task -> edit -> clear provisioned devices cache.

1

I had a similar error when building the project using compileSDK 26 and targetSDK 26. Going back to SDK 25 and supportLibrary 25.4.0 solved the problem for me.

gbaccetta
  • 4,449
  • 2
  • 20
  • 30
  • This was my problem too. changing compileSdk, targetSdk and supportLibrary versions to 25, 25 and 25.4.0 accordingly solved the problem :) – X-HuMan Jul 18 '17 at 11:23
  • Fails for me, says feature modules require a compile sdk of at least 26 – hermt2 Apr 12 '18 at 17:29
1

devman.apk is missing under sdk/extras/google/instantapps/tools/apks/debug folder. Please sideload it manually before running your instant app:

adb install /path/to/android/sdk/extras/google/instantapps/tools/apks/release/devman.apk
ibrahimkarahan
  • 475
  • 2
  • 9
0

In my case the option in (in the emulator)Settings -> Google -> Instant Apps was disabled.
I manually enabled it, then it worked fine.

Sandeep Chauhan
  • 117
  • 1
  • 9