Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"

like image 256
StainlessSteelRat Avatar asked Oct 15 '19 08:10

StainlessSteelRat


People also ask

Is NDK necessary for Android studio?

The Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with Android. CMake: an external build tool that works alongside Gradle to build your native library. You do not need this component if you only plan to use ndk-build.

What compiler does Android NDK use?

The NDK itself invokes a customized cross-compiler built on the arm-eabi-gcc compiler.

Do I need Android SDK and NDK tools?

If you are using the IL2CPP scripting back end for Android, you need the Android Native Development Kit (NDK). It contains the toolchains (such as compiler and linker) needed to build the necessary libraries, and finally produce the output package (APK).


3 Answers

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
like image 164
Mudassar Ashraf Avatar answered Oct 16 '22 13:10

Mudassar Ashraf


There is a better way to work it around now.

You could got to Security & Privacy, open Developer Tools and add your terminal app to the list of the tools. The same could be done for your IDE.

like image 24
Sergey Dryganets Avatar answered Oct 16 '22 12:10

Sergey Dryganets


To allow apps downloaded from Anywhere on MacOs Catalana do this:

sudo spctl --master-disable
like image 12
YuryP Avatar answered Oct 16 '22 12:10

YuryP