herbss
Topic Author
Posts: 5
Joined: 07 Oct 2014, 22:00

Android runtime xaml file loading

12 Jun 2015, 22:19

Environment latest Noesis 1.2 with Unity 4.6.

I'm trying to load a xaml file at runtime using the method in C#:
NoesisGUISystem.LoadXaml(xamlFile).

It works on Windows. However on Android it complains with the output message:
E/Noesis﹕ NoesisError: Resource assets/UI/Views/_Themes/Default.xaml not found.

I can find it under the StreamingAssets\NoesisGUI\android\Assets\UI\Views\_Themes after Noesis builds the nsb files.

Is there a bug around the pathing on Android? Note that I opened and browsed the generated APK and it is also not there. Does the xaml need to be referenced somewhere before I can load it?
 
User avatar
sfernandez
Site Admin
Posts: 1918
Joined: 22 Dec 2011, 19:20

Re: Android runtime xaml file loading

13 Jun 2015, 20:01

...browsed the generated APK and it is also not there.
If the file Default.xaml.nsb cannot be found inside the .apk, then it is impossible to load it.
But you said that the .nsb is generated for the Android platform in the StreamingAssets folder, and that is very strange because Unity copies everything from that folder inside the assets folder in the .apk.
E/Noesis﹕ NoesisError: Resource assets/UI/Views/_Themes/Default.xaml not found.
Looking at this error maybe is a problem with the lowercase 'assets'. Is it possible that your Unity project has the 'Assets' folder in lowercase?
 
herbss
Topic Author
Posts: 5
Joined: 07 Oct 2014, 22:00

Re: Android runtime xaml file loading

15 Jun 2015, 18:52

I managed to get it to work by renaming _Themes to AThemes. I'm suspecting there is a problem with leading underscore character in a folder name.

Can this be confirmed? Now everything loads. Thanks.
 
User avatar
sfernandez
Site Admin
Posts: 1918
Joined: 22 Dec 2011, 19:20

Re: Android runtime xaml file loading

03 Jul 2015, 20:18

I confirmed that folders starting with underscore (like in _Themes) are not deployed from StreamingAssets into the .apk, Unity just ignores them, so they must be avoided if they include NoesisGUI resources.

Who is online

Users browsing this forum: No registered users and 0 guests