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

Uncaught exception: [lime.utils.Preloader] ERROR: There is no asset library with an ID of "default" #1757

Open
T1mL3arn opened this issue Feb 3, 2024 · 2 comments

Comments

@T1mL3arn
Copy link
Contributor

T1mL3arn commented Feb 3, 2024

<?xml version="1.0" encoding="utf-8"?>
<project>
	
	<meta title="TestPath" package="com.sample.testpath" version="1.0.0" company="Company Name" />
	<app main="Main" path="Export" file="TestPath" />
	
	<source path="Source" />
	
	<haxelib name="openfl" />
	
	<assets path="Assets" rename="assets" preload="false"  embed="false"/>
	
</project>

Asset file

Assets/hello.txt
package;

import openfl.display.Sprite;

class Main extends Sprite
{
	public function new()
	{
		super();

		var f = openfl.Assets.loadText('assets/hello.txt');
		f.onError(e -> {
			trace("ERROR");
			trace(e);
		});
		f.onComplete(text -> {
			trace('LOAD COMPLETE');
			trace(text);
		});

		trace('Main created');
		graphics.beginFill(0xFF0000);
		graphics.drawCircle(200, 300, 50);
	}
}
  • lime build hl -debug and rename bin to фыва (non ascii cyryllic chars).
  • try to run app
  • get this error
Uncaught exception: [lime.utils.Preloader] ERROR: There is no asset library with an ID of "default"
Called from lime.utils.$Log.error(lime/utils/Log.hx:37)
Called from lime.utils.Preloader.~updateProgress.3(lime/utils/Preloader.hx:293)
Called from lime.app.Future.onError(lime/app/Future.hx:156)
Called from lime.utils.Preloader.updateProgress(lime/utils/Preloader.hx:241)
Called from lime.utils.Preloader.load(lime/utils/Preloader.hx:183)
Called from $ApplicationMain.create(ApplicationMain.hx:135)
Called from $ApplicationMain.main(ApplicationMain.hx:26)
Called from .init(?:1)

Lime 8.1.1

@T1mL3arn
Copy link
Contributor Author

T1mL3arn commented Feb 3, 2024

I was able to trace it to this

path = @:privateAccess String.fromUTF8(NativeCFFI.lime_system_get_directory(type, null, null));

It returns wrong path if directory contains cyrillic chars.

Placing trace('cwd: ${Sys.getCwd()}'); before this prints desired directory with correct cyrillic name.

--- update

Temp workarounds:

  • [hashlink] change __getDirectory() to return cwd: path = haxe.io.Path.normalize(Sys.getCwd())
  • [hashlink] provide custom ManifestResources.hx with <template path="Source/ManifestResources.hx" rename="../haxe/ManifestResources.hx" /> and in this custom file get cwd the same way
    #elseif (console || sys)
    rootPath = lime.system.System.applicationDirectory;
    rootPath = haxe.io.Path.normalize(Sys.getCwd()) + '/';
    #else
  • [cpp] provide custom ManifestResources.hx with rootPath = "./"

@tobil4sk
Copy link
Contributor

tobil4sk commented Feb 3, 2024

It returns wrong path if directory contains cyrillic chars.

Sounds like it's related to #1472

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

2 participants