Cannot use old NDK (android-ndk-r17c) after Catalina upgrade due to new security

StainlessSteelRat picture StainlessSteelRat · Oct 15, 2019 · Viewed 7.4k times · Source

After upgrading to macOS Catalina, my project won't build anymore. This is due to Catalina believing the binaries in 'android-ndk-r17c' to not be from a trusted developer.

You get messages such as: "“ld” cannot be opened because the developer cannot be verified." "macOS cannot verify that this app is free from malware"

I have to use the old NDK due to problems with native openCV library SDK and newer NDKs. They are working on it, but the newer SDK is not stable enough for me yet.

I was able to get around "clang" and "clang++" not being able to work by going to the security pane and clicking "Allow Anyway" on the security alerts. However, when trying this with "Id", I can get past the first warning by clicking "Allow Anyway" but it seems to be called subsequently and on the subsequent call I do not have the option to allow it to open.

There is no code really. I just have (and have had for a long time) Android Studio NDK reference pointing to the old NDK via the config.

In IDE from NDK, it fails to load "Id":

"“ld” cannot be opened because the developer cannot be verified." "macOS cannot verify that this app is free from malware"

Answer

Mudassar Ashraf picture Mudassar Ashraf · Oct 16, 2019

I just found the solution.

It's a tedious process but:

  1. MacOS: Open up System Preferences
  2. MacOS: Go to Security & Privacy (keep this one open, you'll need it for the entire process)
  3. Unity: Go and build your project. When the error appears click "Cancel"
  4. MacOS: In the Security & Privacy window - go and click "Allow" near the "clang" error - so that the MacOS system will recognize the app and utilise it.
  5. The error will appear again, but this time will ask you to "Open" it. Click "Open"
  6. The build will fail several times due to various dependencies, but it will fail with different files that you will need to allow as in the previous steps.
  7. Build again your project.
  8. If it fails, do the steps again, until it stops failing. Every single error you get with the file not being recognized will be different each time