reinterpretcat / utymap

Highly customizable library for procedural world generation based on real map data
Apache License 2.0
959 stars 151 forks source link

Demo: Android build doesn't display map #90

Closed hluup closed 7 years ago

hluup commented 7 years ago

If I build Unity demo for Android. I can't see a map in any of the scenes. Android studio gives a following error if I pick a scene.

E/Unity: get_persistentDataPath can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. Stacktrace is not supported on this platform. (Filename: ./Runtime/Scripting/ScriptingThreadAndSerializationSafeCheck.cpp Line: 177)

The reason why it works in Unity player seems to be in file EnvironmentApi.cs

public static string ExternalDataPath
{
   get
            {
#if UNITY_EDITOR
                return @"Assets/StreamingAssets/";
#else
                return UnityEngine.Application.persistentDataPath;
#endif
            }
        }
    }
reinterpretcat commented 7 years ago

That's really strange: I checked commits since I made release and there is nothing which can introduce this issue. I will check all class usages in few hours later, but it looks like the problem is something else.

reinterpretcat commented 7 years ago

Checked the source code: it does not ExternalDataPath related problem. Also I've built new android apk and everything is working on real device. UPDATE: might be a problem related to emulator