Playmaker Forum

Playmaker Help & Tips => Android Help => Topic started by: Shawn Kilian on August 22, 2017, 11:48:40 AM

Title: Global Variables missing when published to Android [SOLVED]
Post by: Shawn Kilian on August 22, 2017, 11:48:40 AM
I am using Global Variables to Get/Set Strings.  This works fine in the Editor.  It also works fine when I "Build & Run" as an Android app while my phone is plugged into my PC.  However, if I manually install the APK file via side-loading, my Global String Variables are no longer recognized.

Why would this be happening?
Title: Re: Global Variables missing when published to Android
Post by: djaydino on August 22, 2017, 06:35:09 PM
HI,
Strange indeed.

do you have get/set property actions?
Title: Re: Global Variables missing when published to Android
Post by: Shawn Kilian on August 23, 2017, 05:36:08 AM
Yes I am using Get/Set Property actions to save String Values as Global Variables.

If I change my variables to local variables (instead of Global) they work on Android as an APK file even when I sideload.

Somehow the Global Variables are being stripped when I sideload the app to my phone.
Title: Re: Global Variables missing when published to Android
Post by: djaydino on August 23, 2017, 07:58:46 AM
Hi,
Are you getting the string values from a script?

if so then you can try using the Linker wizard (https://www.youtube.com/watch?v=cnCq-OPuLRE)

but if not from a script you should use as much as possible the standard actions or custom action from the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Title: Re: Global Variables missing when published to Android
Post by: Shawn Kilian on August 23, 2017, 08:49:43 AM
I figured out what it was!  I had "Split Application Binary" checked in the Player Settings --> Publishing Settings, which caused my Android app to publish an .apk file AND an .obb file.  Global Variables are stored in the .obb file, so when I side-loaded the .apk file onto my phone, I forgot to include the .obb file so it never had any Global Variables to reference.

The solution was to UNCHECK "Split Application Binary" so the .obb file is never created.  Now everything works (side-loaded or not).

Thank you for your help, I appreciate it =)
Title: Re: Global Variables missing when published to Android [SOLVED]
Post by: djaydino on August 23, 2017, 09:00:55 AM
Np,
I'm happy you found the issue :)