playMaker

Author Topic: Global Variables missing when published to Android [SOLVED]  (Read 190 times)

Shawn Kilian

  • Playmaker Newbie
  • *
  • Posts: 43
  • Multimedia Designer
    • View Profile
Global Variables missing when published to Android [SOLVED]
« 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?
« Last Edit: August 23, 2017, 08:50:04 AM by Shawn Kilian »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Global Variables missing when published to Android
« Reply #1 on: August 22, 2017, 06:35:09 PM »
HI,
Strange indeed.

do you have get/set property actions?

Shawn Kilian

  • Playmaker Newbie
  • *
  • Posts: 43
  • Multimedia Designer
    • View Profile
Re: Global Variables missing when published to Android
« Reply #2 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.
« Last Edit: August 23, 2017, 06:46:45 AM by Shawn Kilian »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Global Variables missing when published to Android
« Reply #3 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

but if not from a script you should use as much as possible the standard actions or custom action from the Ecosystem

Shawn Kilian

  • Playmaker Newbie
  • *
  • Posts: 43
  • Multimedia Designer
    • View Profile
Re: Global Variables missing when published to Android
« Reply #4 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 =)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Global Variables missing when published to Android [SOLVED]
« Reply #5 on: August 23, 2017, 09:00:55 AM »
Np,
I'm happy you found the issue :)