lime icon indicating copy to clipboard operation
lime copied to clipboard

Version 7.6.0 problems with assets path on different platforms

Open maaniv opened this issue 5 years ago • 4 comments

Fix /haxe/ManifestResources.hx:

if (rootPath == null) {

		#if (ios || tvos || emscripten)
		rootPath = "assets/";
		#elseif console
		rootPath = lime.system.System.applicationDirectory;
		#else
		rootPath = "./";
		#end

	}

```to

if (rootPath == null) {

		#if (ios || tvos || emscripten)
		rootPath = "assets/";
		#elseif console
		rootPath = lime.system.System.applicationDirectory;
		#elseif html5
		rootPath = "./";
		#else
		rootPath = "";
		#end

} 
Tested with PiratePig sample project on linux, android, html5, mac, ios
For ios also need to change src/lime/utils/Assets.hx:
		if (libraryPaths.exists(id))
		{
			path = libraryPaths[id];
			rootPath = (defaultRootPath != "" ? defaultRootPath + "/" : "") + Path.directory(path);
		}
		else
		{
to
		if (libraryPaths.exists(id))
		{
			path = libraryPaths[id];
			rootPath = Path.directory(path);
		}
		else
		{

maaniv avatar Aug 29 '19 13:08 maaniv

I can confirm not being able to build on ios for assets paths problems

filipp8 avatar Sep 14 '19 11:09 filipp8

for html5 target, in Ubuntu, I pass rootPath as:

lime.embed ("MyApp", aHolderID, 0, 0, { rootPath: "<%= lab_assets %>", parameters: {id: "lab_canvas"} });

but it has no effect, its set as blank

hopewise avatar Jan 10 '20 18:01 hopewise

Any update? @maaniv Can you please create a PR that has your fix? or you just fix the generated file after compilation?

hopewise avatar Jan 21 '20 15:01 hopewise

I don't know if the problem still exists, but I think it's worth noting that the second change (the part involving Assets.hx) has already been incorporated. Does the manifest still cause problems?

player-03 avatar Jul 20 '20 05:07 player-03