Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can't Android il2cpp build on macOS Catalina

Discussion in 'Editor & General Support' started by kyubuns, Aug 13, 2019.

  1. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    138
    I try android il2cpp build on macOS Catalina(beta).
    That cause error the screenshot.

    I think android-ndk-r16b can't run on Catalina.
    Is there a solution?
     

    Attached Files:

  2. ScottF

    ScottF

    Vice President, Platforms

    Joined:
    Jul 31, 2013
    Posts:
    96
    This appears to be an issue that that version of Clang for NDK r16b was not signed which under new OSX rules is prevented from running. If you upgrade to Unity 2019.3 (which now has NDK r19) this is no longer an issue. We will investigate what can be done for older versions of Unity/NDK.
     
  3. abuki

    abuki

    Joined:
    Nov 14, 2013
    Posts:
    40
    Hello, is every version of Unity tied a to a specific version of NDK?
    Updating to current alpha is not a solution for me (and I have to be on 10.15 Catalina because of other reasons), so I am really interested if there is some workaround.
     
  4. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    138
    Thank you for your reply.
    I can't use alpha version unity too.
    So I try to build it on another old machine for a while.
     
  5. mamad_m2

    mamad_m2

    Joined:
    Jul 3, 2017
    Posts:
    1
    Same problem here on Unity 2018.4.2. Any updates?
     
  6. dhodosok

    dhodosok

    Joined:
    Sep 25, 2018
    Posts:
    1
    Davideogames likes this.
  7. hearstzhang

    hearstzhang

    Joined:
    Apr 1, 2019
    Posts:
    17
    Hi there, is there any progress of this issue? We have to use 2018.4 lts with ndk r16b which failed to build because of this, and the solution provided by @dhodosok seems useless.
     
  8. hearstzhang

    hearstzhang

    Joined:
    Apr 1, 2019
    Posts:
    17
    Would you like to include NDK releases which matches your Unity version in your Unity release, just like what you've done to JDK? If so, this might be solved once and for all.
     
  9. DiegoR

    DiegoR

    Joined:
    Oct 31, 2012
    Posts:
    33
    This very important problem should be announced in the blog and as a known issue in every version of Unity that is using Android NDK r16b. The unique solution shouldn't be "use Unity 2020.1 alpha version for a production version of your game".

    I don't understand why UT is not use at least one of the many channels available for communication.
     
    tolosaoldfan likes this.
  10. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    386
    For the first time tried to build my Android app with 2018.4 on Catalina.

    I was finally able to get this running by
    - pressing cancel every time an error occurred and accepting access in the macOS privacy settings
    - repeating this for every occurence
    - repeating this for multiple build trials

    but this totally sucks. Any chance to get a better solution in 2018?
     
    kalamtech likes this.
  11. rich-brighton

    rich-brighton

    Unity Technologies

    Joined:
    Jun 13, 2016
    Posts:
    10
    Hi All,

    Try running this script in the root of your NDK installation:

    #!/bin/bash
    echo "Resetting Extended Attributes"
    sudo xattr -cr toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
    sudo xattr -cr toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
    sudo xattr -cr toolchains/llvm/prebuilt/darwin-x86_64/lib64/libc++.dylib
    sudo xattr -cr toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin/ld.bfd
    sudo xattr -cr toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin/ld.gold
    sudo xattr -cr toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy
    sudo xattr -cr toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip
    sudo xattr -cr toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ld.bfd
    sudo xattr -cr toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ld.gold
    sudo xattr -cr toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
    sudo xattr -cr toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
    sudo xattr -cr toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin/ld.bfd
    sudo xattr -cr toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin/ld.gold
    sudo xattr -cr toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-objcopy
    sudo xattr -cr toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-strip
    sudo xattr -cr toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-objcopy
    sudo xattr -cr toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-strip
    echo "Fixing NDK Signing"
    sudo codesign --force --deep --sign - toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
    sudo codesign --force --deep --sign - toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
    sudo codesign --force --deep --sign - toolchains/llvm/prebuilt/darwin-x86_64/lib64/libc++.dylib
    sudo codesign --force --deep --sign - toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin/ld.bfd
    sudo codesign --force --deep --sign - toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin/ld.gold
    sudo codesign --force --deep --sign - toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy
    sudo codesign --force --deep --sign - toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip
    sudo codesign --force --deep --sign - toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ld.bfd
    sudo codesign --force --deep --sign - toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ld.gold
    sudo codesign --force --deep --sign - toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
    sudo codesign --force --deep --sign - toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
    sudo codesign --force --deep --sign - toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin/ld.bfd
    sudo codesign --force --deep --sign - toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin/ld.gold
    sudo codesign --force --deep --sign - toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-objcopy
    sudo codesign --force --deep --sign - toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-strip
    sudo codesign --force --deep --sign - toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-objcopy
    sudo codesign --force --deep --sign - toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-strip
     
  12. ScottF

    ScottF

    Vice President, Platforms

    Joined:
    Jul 31, 2013
    Posts:
    96
  13. waltran

    waltran

    Joined:
    Feb 23, 2017
    Posts:
    36
    with the first method you mentioned i got it working perfectly and easily. thanks and best regards @ScottF
     
  14. KidsGame

    KidsGame

    Joined:
    May 14, 2018
    Posts:
    1
    Unity,

    What exactly to type for Unity 2017.4.3 which is using NDK 1.13 ?
     
    tolosaoldfan likes this.
  15. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Download NDK r13b unsigned (I couldn't see it in the signed installer mentioned), and run the .sh script further up this thread. We've shipped both Mono and il2cpp ARM64 APKs this way (too many issues with broken IAPs if using AAB on Unity 2017.)
     
    tolosaoldfan likes this.
  16. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140