playMaker

Author Topic: SOLVED - Runtime on Device not displaying XML  (Read 3225 times)

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
SOLVED - Runtime on Device not displaying XML
« on: December 07, 2020, 01:37:21 PM »
Hey all,
Im having a problem with XML string (or proxy) not displaying on iOS device.

In Unity editor it works fine, I use Get Web request, and save into a string, variables display the xquery results perfectly.

Once built...I then run on the device thru xcode. Testing on ios device i can see the xml variables are not displayed. Ive updated everything and tried the xml Linker Wizard but still scratching my head?? Could it be some formatting of the XML I need to change that will work nice with xcode?
« Last Edit: February 08, 2021, 06:47:55 PM by zzap64 »

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #1 on: December 09, 2020, 11:51:15 AM »
I dont have much more info to add....im not receiving any errors in the Unity console or Xcode.

I just dont understand why on device none of my XML variables are being displayed, Json is fine. I'm using Datamaker.

Can I supply any further info to help my case here as its driving me crazy? thankyou.
« Last Edit: December 09, 2020, 01:45:52 PM by zzap64 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Runtime on Device not displaying XML
« Reply #2 on: December 09, 2020, 01:52:07 PM »
Hi.
Try setting up A Debug fsm.

Use "Get Fsm State" and use a Ui Text to show on screen.

It might be that it gets stuck in the web request for example

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #3 on: December 09, 2020, 02:52:38 PM »
Hey Thanks for the reply,

good idea on get fsm states, they all worked except the web request, so there lies the culprit I guess. attached a screen shot to see if i'm doing something wrong?
« Last Edit: December 09, 2020, 04:22:59 PM by zzap64 »

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #4 on: December 09, 2020, 05:47:19 PM »
just to add,

what is making my head hurt is that json data the url is getting does show up on the device....its just when its converted to xml it doesn't.
« Last Edit: December 09, 2020, 08:48:34 PM by zzap64 »

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #5 on: December 09, 2020, 09:11:51 PM »
this is what i see in xcode output during runtime:

System.Reflection.Emit.DynamicMethod::.ctor
HutongGames.PlayMaker.Actions.ConvertJsonStringToXmlNode:ConvertFromJsonString()
HutongGames.PlayMaker.Actions.ConvertJsonStringToXmlNode:OnEnter()
HutongGames.PlayMaker.FsmState:ActivateActions(Int32)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:Update()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

FsmXmlSource:GetXmlNodeFromString(String)
HutongGames.PlayMaker.Actions.XmlGetNodeProperties:GetNodeProps()
HutongGames.PlayMaker.Actions.XmlGetNodeProperties:OnEnter()
HutongGames.PlayMaker.FsmState:ActivateActions(Int32)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:Update()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Root element is missing.
FsmXmlSource:GetXmlNodeFromString(String)
HutongGames.PlayMaker.Actions.XmlGetNodeProperties:GetNodeProps()
HutongGames.PlayMaker.Actions.XmlGetNodeProperties:OnEnter()
HutongGames.PlayMaker.FsmState:ActivateActions(Int32)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:Update()
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
« Last Edit: December 09, 2020, 11:23:39 PM by zzap64 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Runtime on Device not displaying XML
« Reply #6 on: December 10, 2020, 07:53:16 AM »
Hi.
For testing you should set the get fsm state action in a separate fsm/gameobject.
then you can see if it stops somewhere.

Other way you could do testing is add a 'Get Key Down' this way you can do each state step by step.

after the web request 1st try if it shows the json data. (display stored thext)

then next, after convert show if xml is showing.

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #7 on: December 10, 2020, 07:59:15 PM »
Thanks again for your swift reply, really appreciate your help. This is an app for my local community.


I went step by step and xcode shows 'root element is missing' at my get xml nodes state.


see attached, a combined screen shot of my state flow. as you can see the xml variables are populated in the editor but ultimately not on device. thankyou.

ps. i'm wondering if the 'root' for the json file is the issue? do i just add an arbitrary root name such as 'root' or is there a string ref in the json file i should use?
« Last Edit: December 10, 2020, 09:02:55 PM by zzap64 »

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #8 on: December 10, 2020, 09:02:31 PM »
adding json string txt attachment.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Runtime on Device not displaying XML
« Reply #9 on: December 11, 2020, 06:10:02 AM »
Hi.
I haven't used json yet, only xml.

maybe you can try to make a build on mac/windows platform and see if it works there.

i will ping Jean if he knows what the issue is.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Runtime on Device not displaying XML
« Reply #10 on: December 11, 2020, 06:15:15 AM »
Hi,

 that's very odd, I am using datamaker everyday and publish on IOS often without any problem.


- Are you sure you are getting the same data on IOS than in editor?
- Can you send me the raw data you are using? I'll try on my end.

- there could be some location issue that on IOS the text is saved and encoded differently. Do you think you could face something like that?

Bye,

 Jean

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #11 on: December 12, 2020, 10:57:48 PM »
Hey Djaydino & Jean (appreciate your continued help)

I tried a Mac build (and WebGL) and it does the same problem so now we know its not related to device.

I added a couple examples of the of the urls i pull.

as a side test....I thought to create a new basic project, just with the web request and UI actions to display the variables but I couldn't find Web Request on the Eco system, where is that action?
I stripped out everything from my current project so can make that available if you need it.
« Last Edit: December 14, 2020, 06:09:31 PM by zzap64 »

zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #12 on: December 14, 2020, 01:04:11 PM »
I managed to get my url source as xml without having to convert from json, I  adjusted the xpath query and it worked on the Mac build...yay...BUT on ios device it still shows a blank! sad face. now i'm really stumped.


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Runtime on Device not displaying XML
« Reply #13 on: December 14, 2020, 05:51:00 PM »
Hi.
I have no experience in building for ios so i need to guess as well :)

Have you tried to use a xml directly in build (so without getting from url) to test.

if that works then it might be when getting it from the url.


zzap64

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Runtime on Device not displaying XML
« Reply #14 on: December 15, 2020, 01:04:00 AM »
hiya,

ok, one big step nearer :)

my url's with xml as its source works ok, no matter on what device. I played around with xml variables and xpath and some how magically started to work.

my remaining issue is the action of Json to XML conversion, this is where i seem to have problems. Editor is fine but xcode brings back the same old issues of a problem root on the converted xml.
I have converted the json to xml via an online web converter tool and accessed that xml string at runtime on the device and it works fine.

Leads me to think I must be doing something wrong with the Datamaker json to xml conversion action???

As per attachments, XML says valid and on the json>xml conversion I just save the xml as a string variable. also added the json text from the url.

« Last Edit: December 15, 2020, 01:20:06 AM by zzap64 »