playMaker

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

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Global Variables missing when published to Android [SOLVED]
« on: August 22, 2017, 02:48:40 PM »
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, 11:50:04 AM by Shawn Kilian »

djaydino

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

do you have get/set property actions?

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Global Variables missing when published to Android
« Reply #2 on: August 23, 2017, 08: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, 09:46:45 AM by Shawn Kilian »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Global Variables missing when published to Android
« Reply #3 on: August 23, 2017, 10: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

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Global Variables missing when published to Android
« Reply #4 on: August 23, 2017, 11: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: 7616
    • jinxtergames
Re: Global Variables missing when published to Android [SOLVED]
« Reply #5 on: August 23, 2017, 12:00:55 PM »
Np,
I'm happy you found the issue :)