Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Launching app on Android without internet access displays "You're Offline" error and quits — Gideros Forum

Launching app on Android without internet access displays "You're Offline" error and quits

This is something new that's happening in one of my recently updated apps. If I'm offline (WIFI off, airplane mode) the app launch screen will appear briefly, then the app will close and Google Play brings up this screen:


I assume this is behavior triggered by using an API dependent on Google Play, so I assume that's the Iab plugin. At startup the app uses Iab to get the available products. Has a change to the Google Billing API happened that will trigger this error if an attempt is made to use the API while offline? If so I'll have to do some other checks for network access before attempting to use Iab. Right now this behavior makes the game unplayable while offline.

Paul

Likes: pie

+1 -1 (+1 / -0 )Share on Facebook

Comments

  • PaulHPaulH Member
    I think I've finally figured out what's going on here. If the app was released for internal testing through the Google Play console, it won't run offline until it's been run at least once with internet access. I suspect Google Play just wants to confirm it's being run by one of the internal testers specified for the developer account. So to see how it will behave offline, run it online once first.

    Likes: MoKaLux, hgy29

    +1 -1 (+2 / -0 )Share on Facebook
  • PaulHPaulH Member
    Strike that. The issue remains. If the app has been run online recently (not sure the timing) it will run offline, but if I try it after a while, the Google Play offline error appears. And this happens with the production release, so it's not just an issue for internal testing releases. If the app has just been run online, then taken offline, it works fine even if I clear the app's cache, but once I clear the app's data, it returns to the non-working state.

    What's really strange is that if I export the project as just a player, release that for internal testing, run it online and run the project on it, it works as it should. The project can be run consistently from that player offline. That suggests the issue isn't specific to the way the app is built (what plugins or other settings are included) or the error would happen when the player version of the app is launched offline. It also suggests the issue isn't caused by the app's code, or the error would occur when running that app within the player.

    Yet other comparable apps I've recently updated with the latest Gideros version work fine offline. It's a strange puzzle. I'll keep digging.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • PaulHPaulH Member
    edited August 19
    I found the cause. The Google Play developer console encourages you to enable "Automatic Integrity Protection", to make it harder to create and distribute pirated versions of the app. What they don't say is enabling that will mean the app can't run offline, at least when it hasn't been run online in the last few hours, but that's a consequence of their system. It seems that when an app using that feature starts, if it hasn't validated itself with Google very recently, it will try to do so, and not run at all if it can't reach their servers.

    The bottom line is: Turn off Automatic Integrity Protection on any app you expect people to be able to use without an internet connection.

    I see that under the advanced settings of AIP there's the default option "Require installation from Google Play - Add checks to see if your app was installed from Google Play. If it was not, users will be prompted to re-install your app from Google Play." It might be that having AIP turned on, but that option turned off, it might work offline, but then I don't know what good AIP would do without that.

    Likes: MoKaLux, pie

    +1 -1 (+2 / -0 )Share on Facebook
  • good catch PaulH ;)

    Likes: PaulH

    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.