Reputation: 853
Problem: When attempting to test Instant App to Full app conversion using
InstantApps.showInstallPrompt(activity, intent, INSTALL_REQUEST_CODE, referer);
Google Play Store send a notification with the error
Can't Install App,
APP_NAME
is already installed on this device. If additional support is needed, get help troubleshooting. (Error code: -1).
The instant app then hangs on the download progress screen and never downloads the app.
We are currently testing the instant app using the Alpha channel on google play. The instant app shows up correctly when the app isn't installed, and the full version also works fine when downloaded directly.
If I install the debug version of the instant app on my phone and then in that version call the install prompt api, it also works fine. It just doesn't work when you try and install it from the instant app that is hosted on Google Play.
Device Being Used
Pixel 2 XL - (Error Code -1)
Samsung Galaxy Note 3 - (Error Code 491)
Pixel 2 XL (8.1) - (Error Code 944)
Upvotes: 1
Views: 741
Reputation: 853
I figured it out, the instant app has to have a version code that is less than one in the full apk. I adopted a version system like this so every time I release an update to the installed apk I can update the instant app 100 times without having to bump the installed version code.
baseVersionCode = 1
versionCode = baseVersionCode * 100
instantAppIteration = 1
instantAppVersionCode = versionCode - (100 - instantAppIteration)
instantAppVersionName = versionName + "-" + instantAppIteration + "-IA"
Upvotes: 2