Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Android Build Error (System.ComponentModel.Win32Exception (8): Exec format error)

Discussion in 'Android' started by SilentX0, Aug 3, 2022.

  1. SilentX0

    SilentX0

    Joined:
    Aug 9, 2021
    Posts:
    5
    Hello,

    I am trying to create an Android build but keep facing build errors.

    Error:
    System.ComponentModel.Win32Exception (8): Exec format error

    Editor Log:
    https://pastebin.com/DhGAGdcQ

    Unity version: 2020.3.4f1

    Would really appreciate any help!
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Can you check if it works with latest 2020.3 LTS? Which is today 2020.3.37f1
     
  3. SilentX0

    SilentX0

    Joined:
    Aug 9, 2021
    Posts:
    5
    Yes I checked and I still get the same error on version 2020.3.37f1
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Are you running on Mac? Is it by chance Mac Silicon?
     
  5. SilentX0

    SilentX0

    Joined:
    Aug 9, 2021
    Posts:
    5
    No I am running it on Mac Intel , macOS Montery
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    The log says you're using NDK from
    /Users/zeinathabet/Documents/android-ndk-r19, could you try using NDK embedded within Unity?
     
  7. SilentX0

    SilentX0

    Joined:
    Aug 9, 2021
    Posts:
    5
    yes, that actually fixed it!

    However now I am facing another error related to gradle. I did google the error but couldn't find anything useful.

    Should I open another thread?

    Here is the error log just incase:
    https://pastebin.com/7MzGm6ia
     
  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Thats a similar problem, try using embedded Unity JDK, looks like you're using a custom one
     
  9. SilentX0

    SilentX0

    Joined:
    Aug 9, 2021
    Posts:
    5
    I just fixed it by simply closing and reopening Unity.

    Thanks a lot for your help, I was stuck on the first error for very long hours
     
    Tomas1856 likes this.