64-bit Android support in Legacy

Hi,

I developed an App with Haxeui V1, which depends on Lime 2.9.1 I believe. The Android Store now requires the inclusion of 64-bit architectures, and it seems support for this was added in Lime 7.5.0.
https://community.openfl.org/t/does-openfl-support-64-bit-devices-on-android/11517
https://community.openfl.org/t/does-64-bit-support-in-older-versions-of-android/11732

However, I currently seem to be stuck as the binary including 64-bit is not generated for legacy builds.
Is this correct? Or is legacy support for 64-bit also supposed to work?

I created a very simple Haxeui V1 project for testing purposes:

Project.xml:

<?xml version="1.0" encoding="utf-8"?>
<project>
	<meta title="Googletest1" package="com.sample.googletest1" version="1.0.0" company="Company Name" />
	<app main="Main" path="Export" file="Googletest1" />
	<architecture name="arm64" if="android" />
	<config:android minimum-sdk-version="19" target-sdk-version="28" /> 
	<source path="Source" />
	<haxelib name="haxeui" />
	<assets path="Assets" rename="assets" />
</project>

Main.hx:

package;

import openfl.display.Sprite;
import haxe.ui.toolkit.core.Root;
import haxe.ui.toolkit.core.Toolkit;
import haxe.ui.toolkit.controls.Button;

class Main extends Sprite {
	var m_uiRoot:Root;
	
	public function new() {
		super();
		Toolkit.init();
		m_uiRoot = Toolkit.openFullscreen();
		var b:Button = new Button();
		b.text = "test";
		m_uiRoot.addChild(b);
	}
}

Haxelib list:

actuate: 1.8.7 [1.8.9]
box2d: [1.2.3]
datetime: [3.1.1]
format: 3.4.1 [3.4.2]
haxeui-file-dialogs: [0.1.1]
haxeui: [1.8.21]
hscript: 2.1.1 [2.3.0]
hxcpp: 3.4.188 [4.0.4] 4.0.8 4.0.19
layout: [1.2.1]
lime-samples: 6.2.0 [7.0.0]
lime: 2.9.0 [2.9.1] 6.2.0 7.5.0
openfl-samples: 6.0.0 [8.7.0]
openfl: 3.6.1 7.1.2 8.9.0 [8.9.1]
unifill: [0.4.1]

This builds and generates a basic APK.
I can also set openfl from 3.6.1. to 8.9.1 without problems.

Setting hxcpp from 4.0.4 to 4.0.8 or higher does not build: Error: Source path “C:\Trunk\dev\HaxeToolkit\haxe\lib\hxcpp/4,0,19/bin/Android/libstd-v7.so” does not exist.

Setting lime from 2.9.1 to 7.5.0 builds and generates the APK with 64-bit support. But it causes a crash: Could not load module [email protected]_legacy_byte_array_init__4

Any suggestions on how to make this work?

You should be able to port to newer OpenFL using the drawQuads API (if you were relying on drawTiles)


That would be one approach.

The other would be to use the Lime “legacy” branch on Github and try and back-port 64-bit support. That would require updates to the older tools and to the Build.xml under the legacy folder as well

(You can ignore iOS-related changes in this search)

I would accept pull requests to the legacy Lime branch if you do make these changes, or happy to work with you if you’re seeing problems moving to newer OpenFL versions

Hi!
Is there any particular reason you are still using haxeui v1? I mean, its verrrry old and doesnt get updated at all… Is there some issue migrating to v2 that is blocking you? I would certainly suggest moving to v2 if at all possible :slight_smile:

Cheers,
Ian

Hi Ian,

as far as I know Haxeui V2 hasn’t been officially released yet, and the last thing I heard was the dev branch not working for Android releases. Currently Haxelib lists 1.8.21 as the latest version.
Am I wrong? Should I switch to the dev branch?
Is there a document for migrating code to V2 somewhere?

Right… Yeah, there isnt a haxelib (recent) release yet… Also, its not “haxeui” (in haxelib) anymore… its “haxeui-core” and then various “backends”:

  • haxeui-android (native / wip)
  • haxeui-flixel
  • haxeui-heaps (incomplete)
  • haxeui-html5
  • haxeui-hxwidgets (native)
  • haxeui-kha
  • haxeui-nme
  • haxeui-openfl <------ this is probably the one you want
  • haxeui-pdcurses
  • haxeui-pixijs
  • haxeui-qt (native / wip)
  • haxeui-winforms (native)

If you wanted to evaluate them before the haxelib release (which i hope to be soon!) you’ll have to grab core + backend from github: https://github.com/haxeui

There should be general instructions there, but let me know if something isnt clear / doesnt work.

As for migration… … … im hoping it shouldnt be too harsh… especially if you’ve used xml layouts… but its hard to know without seeing the application.

Let me know if you need a hand or something breaks… Also, fyi, there is a forum here: https://community.haxeui.org/ (which may help and might be a good place to post issues) and there is a #haxeui room in the haxe discord.

Hope that helps somewhat… :slight_smile:
Ian

Ok, I will try migrating. It does work under Android right?

It should do, yes, i havent actually tested that in a while (for haxeui-openfl)… but it should, yeah. Ill retest also when i get some time, but let me know if there are issues.

Ian

So I migrated a bunch of code and that works for the most part. However, I have some other apps that are not yet migrated, and do not absolutely need to be, but I do want to make some small changes and I’m running into errors.

I did update everything from legacy to the most recent libs etc. But I did set all the haxelibs back to the legacy versions. A rather unclear error I get is:

Called from ? line 1
Called from CommandLineTools.hx line 1400
Called from CommandLineTools.hx line 25
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 562
Called from lime/tools/platforms/AndroidPlatform.hx line 25
Called from lime/tools/platforms/AndroidPlatform.hx line 37
Called from lime/project/HXProject.hx line 244
Called from lime/project/ConfigData.hx line 35
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 76
Called from C:\trunk\dev\Haxetoolkit\haxe\std/neko/_std/Array.hx line 118
Uncaught exception - Invalid operation (+)
Build halted with errors.

I’ve seen this error pop up more often on the web, and usually this is something related to the setup. The fix is usually reinstalling or running “lime rebuild tools”. I’m not going to reinstall since I need my current setup to work on the up to date 64-bit apps. And the above error actually shows up after “lime rebuild tools”. Before that the build ran for a while and java complained about a couple of duplicate classes like HaxeObject.

The above error occurs pretty much immediately and I know this error occurs while the HXProject and its ConfigData are being cloned. I don’t know why that fails and it seems this should “just work”.
I did install haxe 4.0.0rc3 and haxe 3.4.7. multiple times while I was trying to get the modern 64-bit stuff working. In the end I remained on haxe 3.4.7.

Haxelib list:

actuate: 1.8.7 [1.8.9]
box2d: [1.2.3]
datetime: [3.1.1]
format: 3.4.1 [3.4.2]
haxeui-core: 0.0.4 Copy git changes [git]
haxeui-file-dialogs: [0.1.1]
haxeui-openfl: 0.0.2 [git]
haxeui: [1.8.21]
hscript: 2.1.1 [2.3.0]
hxcpp: 3.4.188 [4.0.4] 4.0.8 4.0.19 4.0.52
hxp: 1.1.2 1.1.3 [1.1.4]
layout: [1.2.1]
lime-samples: 6.2.0 [7.0.0]
lime: 2.9.0 [2.9.1] 6.2.0 7.5.0 7.6.0 7.6.2 7.6.3
openfl-samples: 6.0.0 [8.7.0]
openfl: [3.6.1] 7.1.2 8.9.0 8.9.1 8.9.2 8.9.4 8.9.5
unifill: [0.4.1]

Could it be the hxproject is cached somewhere? I know there is a cache-issue in my up-to-date modern gradle build of another project where the .build file gets ignored until I rename the project folder… But legacy uses ant instead of gradle right?

While trying to narrow down the problem I was fiddling with a reduced project.xml and noticed having one android permission was ok, but more than one resulted in the build error above. Pretty sure that’s not actually pointing to the issue though…

Any suggestions as to what the problem is? How to fix this error without reinstalling?

I think that was solved in this old commit:

EDIT: BTW we will accept pull requests to the legacy branch on Github

1 Like

Actually the change did work, I was messing around with different versions of lime and haxelib etc. and I ended up applying the fix in the wrong lime version.

I did run into other issues afterwards, and for some reason my lime 2.9.1 build currently tries to create 64 bit libs and it goes horribly wrong etc. I also tried “openfl rebuild hxcpp android”, that may be the cause. But I can get this to work with lime 2.9.0. And hopefully this was the last time I have to deal with legacy.

Thanks for pointing me to the fix!

------------- old comment ----------

I made the changes locally but unfortunately the same error occurs.

But code changes shouldn’t be needed right?

This old app was building just fine in legacy before.
Then I updated the haxelibs, rebuild lime tools, migrated another app to be 64-bit haxeui v2.
Then I set the haxelib versions back to legacy, rebuild lime tools and now it no longer builds.

I’m guessing something did not get changed back…

1 Like