Open IriySoft opened 1 year ago
Which NDK version are you using?
Which NDK version are you using?
Tried with two build configurations:
Config 1 NDK 21.4.7075529 java 17.0.4.1 2022-08-18 LTS
(I put NDK 24.0.8215888 originally here, but it was a mistake)
Config 2 android-ndk-r21e openjdk 11.0.18 2023-01-17
Both configs haxelib: [4.0.3] hxcpp: [4.3.2] lime: [8.0.1] openfl: [9.2.1] haxe: 4.3.0 android target-sdk-version="31" android minimum-sdk-version="21" android gradle-version="7.3.3" android gradle-plugin="7.2.2"
Quick update, maybe this helps to nail the issue. When launching with MEmu (that has Android 7.1) I've got a different error (see the screenshot below). Same emulator runs the same app built with previous version of Haxe+HXCPP perfectly fine.
NDK r21e is the newest known NDK to work with Lime/hxcpp right now, and 24 is definitely expected to fail. We intend to support newer NDKs in the future, though. Before r21e, r15c was usually our recommendation, so that might be worth trying too.
It's certainly possible that something needs to be fixed in Lime to properly support Haxe/hxcpp 4.3, though. Personally, I haven't had a chance to fully test things out.
NDK r21e is the newest known NDK to work with Lime/hxcpp right now, and 24 is definitely expected to fail. We intend to support newer NDKs in the future, though. Before r21e, r15c was usually our recommendation, so that might be worth trying too.
Oh actually it was a mistake. I do have NDK 24 installed, but NDK 21 is used for Android build. Sorry for the mess, the NDK in config 1 is 21.4.7075529. Will edit the original post too.
It's certainly possible that something needs to be fixed in Lime to properly support Haxe/hxcpp 4.3, though. Personally, I haven't had a chance to fully test things out.
Thanks, it's actually easy to test since the issue can be reproduced with an emulator, hope it can be addressed. On our end we just don't have enough understanding to try to fix it :)
Use r15c is ok?
Tested, use r15c
NDK is ok.
Tested, use
r15c
NDK is ok.
Does "OK" mean that the APK doesn't crash, or that it compiles? :) Anyway, r15c is outdated and it's not a good solution even if it works.
Yes, it can compile normally and this error will not occur: __atomic_compare_exchange_4
, agree that it's too old! :)
We actually build lime.ndll with NDK r15c because this is the only known NDK that works for it. For a long time, r15c was also the only known good NDK for building apps too. My discovery that r21e worked for apps is relatively recent. It's unfortunate that it doesn't seem to work with Haxe 4.3.
In Lime 8.2.0, the a number of dependencies and things have been updated, and we found that we could build lime.ndll with r21e. Presumably, when using Lime 8.2.0, you will be able to build an app with r21e too. You could try a nightly build of Lime from the 8.2.0-Dev branch, if you want to test things out.
Lime 8.2+ should be able to start using newer NDKs than r21e after the next hxcpp update because HaxeFoundation/hxcpp#992 was merged recently (but it hasn't been released to Haxelib yet).
Thanks! :)
Was the issue actually fixed? I'm thinking to move to the latest OpenFL/Lime. :)
@pozirk As I recall, you won't get the __atomic error as long as you use NDK r15c.
For those who don't mind living on the edge, using the 8.2.0-Dev branch of Lime and the latest master branch of hxcpp allows you to bypass NDKs that cause the __atomic error and use the latest NDK r25.
I’ve updated haxe to 4.3.0 and then OpenFL, Lime, HXCPP and other haxelibs to the latest versions.
Then compiled PiratePig example that is a part of OpenFL samples (GitHub - openfl/openfl-samples: Haxelib-based OpenFL sample projects).
The resulting build crashes on launch on Redmi 9C NFC (Android 10) with the following error:
The same build works fine on other devices that we have (Android 11+).
The Android build enviroment (NDK, Java and such) was the same as before the Haxe update and it worked well before.
Switching to older versions of OpenFL and Lime doesn't fix the issue. Switching to the previous hxcpp version is not possible with the new Haxe version installed.
The log is blow (filtered for the PID).
Also posted at openfl.org, sorry for the duplicate, just wanted to make sure this issue is noticed.