Android builds that uses Haxe 4.3+ and HXCPP 4.3+ crash on some devices

@IriySoft

I was able to reproduce this error message with an OpenFL app on one of my Android devices.

Copying the error message below for more context in searches:

SDL Error
An error occurred while trying to start the application. Please try again and/or reinstall.
Error: dlopen failed: cannot locate symbol “__atomic_compare_exchange_4” referenced by “/data/app/org.openfl.samples.piratepig-BgzsbLgcUjNKy7Hr5k-Fvg==/lib/arm/libApplicationMain.so” …

I tried to set up my environment as closely as I could to what you reported.

  • Haxe 4.3.4
  • NDK 21.4.7075529
  • Java: OpenJDK 11
  • hxcpp 4.3.2
  • Lime 8.1.2
  • OpenFL 9.3.3

I was able to successfully resolve this issue on my Andorid device by installing the latest hxcpp from GitHub instead of using hxcpp 4.3.2.

As a bonus, this also made it possible for me to use a newer NDK than I ever had in the past. Previously, I was not able to use anything newer than NDK 21.4.7075529. With the latest hxcpp, I was able to successfully build with NDK 25.2.9519653.

2 Likes