Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"default" Asset library path is incorrect, crashes on start #1331

Closed
keyreal-code opened this issue Jun 14, 2019 · 7 comments
Closed

"default" Asset library path is incorrect, crashes on start #1331

keyreal-code opened this issue Jun 14, 2019 · 7 comments

Comments

@keyreal-code
Copy link

Hello,

Getting the following error: [lime.utils.Preloader] ERROR: There is no asset library with an ID of "default" when trying to start a Lime application (porting an existing game engine to a newer Lime).

Native target, Windows, develop branch.

Traced down the problem to Assets.loadLibrary, which sets path to "/manifest/default.json". Adding a line that changes path to "manifest/default.json" (without the leading slash) before calling AssetManifest.loadFromFile fixes the issue.

I'm not sure what is the actual cause of this bug, so I can't provide a meaningful pull request at this point.

@keyreal-code
Copy link
Author

Another issue, which might be related to this: unembedded assets are not loaded and result in a crash.

I'm calling Assets.getImage("textures/perlin.png") in the code. The image file exists. The project.xml contains the following line: <assets if="dev" path="assets/textures" rename="textures" embed="false" />

The id "textures/perlin.png" is eventually passed to AssetLibrary.getImage, where it attempts to resolve the path by calling paths.get(id), which returns the string //..//textures/perlin.png. This is passed to Image.fromFile which then eventually throws a NPE.

Embedded assets seem to be loaded fine.

@keyreal-code
Copy link
Author

It seems like the second problem happens because the basePath in AssetManifest is set to //..//. Forcefully setting it to blank character `` solves this.

@ianharrigan
Copy link

I also, seemingly suddenly, hit this issue. Using the proposed fix:

if (path == "/manifest/default.json") {
    path = "manifest/default.json";
}

in lime.utils.Assets seemed to get past the crash, however, it also seems that now i cant actually get any of the resources (listed in an include.xml from a haxelib project)

This was an app that was previously working, i did do an openfl upgrade and i think the only thing that updated was hxcpp... not sure if that might help to get to the root of the issue.

Cheers,
Ian

@AlexHaxe
Copy link

AlexHaxe commented Jun 17, 2019

I had the same issue on a Windows system that was updated to hxcpp 4.0.19. The app would compile and run fine on Linux and neko (Linux and Windows), but on C++ it would show a message box complaining about missing default asset library and a stacktrace (when running with -debug) or simply show a white screen with a frozen progress bar (without -debug).

My fix was to go back to hxpcpp 4.0.8 (that's the version I had running before, there might be later versions that also fix the issue)

edit: I should mention I used Haxe 3.4.7

@ianharrigan
Copy link

I can confirm @AlexHaxe's solution. Reverting back to hxcpp:4.0.8 makes the issue go away.

@Gama11
Copy link
Member

Gama11 commented Jun 17, 2019

I just found that this only happens when latest hxcpp is used together with Haxe 4.0.0-rc.2 or earlier. Hxcpp 4.0.19 seems to work fine with rc.3.

@Gama11
Copy link
Member

Gama11 commented Jun 21, 2019

This has been fixed in hxcpp:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants