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

无人久伴 提交于 2020-04-08 08:57:50

问题


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"


回答1:


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



回答2:


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

sudo spctl --master-disable



回答3:


I'd like to add to Mudassar Ashraf's answer.

If you don't see «Allow» option after clicking «Cancel», switch «Allow apps downloaded from» in Security window to «App Store and identified developers». This somehow will make «Allow» button appear. Then switch it back to «Anywhere». Repeat if necessary.




回答4:


If by some reason in your Security & Privacy window button allow doesnt appear then just move your ndk to different directory and try whole process again.



来源:https://stackoverflow.com/questions/58390545/cannot-use-old-ndk-android-ndk-r17c-after-catalina-upgrade-due-to-new-security

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!