Jump to content

Torque2D on Patreon


Recommended Posts

Major Problem:

Now coming up to the time to release the app on the play store im building the signed apk for upload and there is an error everytime i try to build

error: undefined reference to 'png_init_filter_functions_neon'

i have no idea even where to begin with fixing this ive tried everything i could find on github and stackoverflow

Link to comment
Share on other sites

  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

last problem i ran into after uploading to the play store and all and getting everything ready for release an error came up, as of august 2019 all apps must include support for 64bit, basically arm64-v8a

i have added to types.gcc.h

#elif defined(__aarch64__)
#  define TORQUE_CPU_ARM
#  define TORQUE_64


then to Android.mk at the bottom before LOCAL_ARM_MODE := arm


ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), arm64-v8a))
    LOCAL_ARM_NEON := true


in Application.mk


APP_ABI   := armeabi-v7a x86 x86_64 arm64-v8a


and finally in the build.gradle for the app


abiFilters 'x86', 'x86_64', 'armeabi-v7a' , 'arm64-v8a'


folders had to be created for the prebuilt libraries for freetype and openal and i copied over the prebuilt libraries for armeabi-v7a, everything seems to build and work fine but i think arm64-v8a will require its own prebuilt libraries.

Link to comment
Share on other sites

Okay arm64-v8a definitely needs its own libraries error message output

libfreetype.a: error adding symbols: File in wrong format

i cant release my game because of it now. Can anyone build the prebuilt libraries for android? I cant seem to get it to work. Tried cygwin and even tried building on my linux virtual machine and cant figure it out

The two prebuilt ones are freetype and openal

Link to comment
Share on other sites

its okay after some more digging i got libraries made for arm64 and im now putting it up on the store!

some of these changes may need to be added to the repo, part of the reason why i was putting so many posts here was because im keeping track of what im doing, these will probably need to be made available to people as a pull request, especially since google is making it mandatory and in 2021 its going to be that no 32bit app is going to be supported only 64bit

Link to comment
Share on other sites

Yeah it seems to be grand now. no errors on play console showing up, some of the changes i have made will need to be added to the git for android developers so they can be released on play store since google is making it mandatory for 64bit.

Another thing, ive created a few scripts that do certain functions that come easy in other game development kits, i will collate these all together into the ToyAssets with their own folder and documentation on what they do and how to use them when i get a chance

Link to comment
Share on other sites

now added a way to find out if the device the user is using is a tablet or a phone when running on iOS or Android devices.

simply call from script


if($deviceType $= "tablet") 
 //do something different for tablets


this value can also check if device is phone. If you are working a cross device game you can now set your camera to scale appropriately and all artwork providing they are 1:1 at multiples of 4 should rescale properly to a different camera size. For example on my app i have the phone to be a camera size of 90,160 (reverse due to portrait) but for tablets i have it set to 180,320. This way all artwork ends up looking about the right size for the screen.

Also for anyone working on iOS and you are getting black bars at the top and bottom of the screen, you have to create a launch screen.storyboard and set it to launch as your targets App Icons and Launch images Launch Screen File. This then resets UIScreen mainScreen to be the correct size.

And lastly if you are getting a weird offset in touches on iOS it is because of this code here:


S32 _iOSGetPortraitTouchoffset()
// NOTE: This needs to be changed to acount for different retina sizes, but I am not sure what is going on with it yet
    S32 offset = 0;
    S32 deviceType = Con::getIntVariable("$pref::iOS::DeviceType");
    bool retinaEnabled = Con::getBoolVariable("$pref::iOS::RetinaEnabled");
    if (deviceType == 2)
        offset = 500;
    else if (deviceType == 1)
        offset = retinaEnabled ? 500 : 250;
        offset = retinaEnabled ? 320 : 160;
    return offset;


due to ios apps now only being released to iOS 7+ devices this offset is irrelevant but you cannot remove it completely or it will break touches after a few. so just comment everything out apart from S32 offset = 0; and the touches should then be accurate

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...