- Home /
Failed to link 'libunity.so'
I am trying to build a 64bit version of an old app. I migrated the app to the new version (2019.1.10f1) of unity and it works as expected. But when I try to build the apk I get an error "Failed to link 'libunity.so'" and the following message appears in the Console:
C:/Program Files/Unity/Hub/Editor/2019.1.10f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld.bfd.exe: cannot find -lgnustl_static
What am I doing wrong? I have tried several solutions posted on line but none have worked so far.
Any help would be appreciated
Here is a screenshot of the build errors:
Answer by kuanghsin-liu · Jul 17, 2019 at 01:16 PM
Are you using IL2CPP and with Strip Engine Code checked in your PlayerSettings? I'm having the same issue after upgraded from Unity 2019.1.8f1 to 2019.1.10f1. And I found if you unchecked Strip Engine Code in PlayerSettings, you can build as normal.
$$anonymous$$any $$anonymous$$any Thanks $$anonymous$$uanghsin-liu!!!
Your solution worked perfectly for me. :)
Answer by Riddhesh · Aug 21, 2019 at 09:04 PM
Unchecking Strip Engine Code in player settings worked for me.
Answer by Wolvorine_911 · Jul 17, 2019 at 11:39 AM
In my case sometimes unity builtin NDK tools have issues ! try Scipting Backend : mono (if IL2CPP) in target architecture only select arm v7
see if that resolves the issue . if it does
Then redownload NDK from the internet and paste it in : C:\Program Files\Unity\Hub\Editor\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer
Hope it resolves your issue !
Answer by moscas99 · Jan 21, 2020 at 09:44 PM
You need to specify the address where the sdk is directed to, the tools folder that you get when you download them, for example if your tools folder is in MySDK folder, do not select the MySDK folder, but the tools folder inside it as the address of the SDK, this will solve the problem
@fgalizia Sorry but I didn't see your answer till today, the folder Is where you selected to save the SDK if you don't know just look for SDK folder as when you look for a file un your computer
Answer by Ghazi-Murad · Dec 02, 2021 at 07:02 PM
In my case, I unchecked "optimize mesh data" box. and it worked.
Your answer
Follow this Question
Related Questions
il2cpp android build error unity 2019.1.6f1 6 Answers
No Android APK is made when building 64-bit - IL2CPP error 2 Answers
Error when building peogram onto Android device 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Android - Building Beta Problems. 0 Answers