Gradle build for Android with IL2CPP failed on macOS Big Sur

Hello,
I could build my unity project since today. Don’t know what has changed.

OS: macOS Big Sur 11.2.3 (Xcode is up to date)
Unity Version: 2020.1.16f1
Gradle Version: 6.5
Scripting Backend: IL2CPP (ARMv7, ARM64)

Export out of Unity works fine, but building in Android Studio failed with strange errors:

Execution failed for task ‘:unityLibrary:BuildIl2CppTask’.

A problem occurred starting process ‘command ‘/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe’’

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:unityLibrary:BuildIl2CppTask’.
    Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process ‘command ‘/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe’’
    Caused by: net.rubygrapefruit.platform.NativeException: Could not start ‘/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe’

Cause: error=13, Permission denied

Even if I change rights of il2cpp.exe to 744 I get strange error code 126 (says that file couldn’t be executed).

finished with non-zero exit value

I wonder why my build.gradle file out of Unity gets configuration to .exe files:

def BuildIl2Cpp(String workingDir, String targetDirectory, String architecture, String abi, String configuration) {
exec {
commandLine(workingDir + “/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe”,
“–compile-cpp”,
“–libil2cpp-static”,
“–platform=Android”,
“–architecture=” + architecture,
“–configuration=” + configuration,
“–outputpath=” + workingDir + targetDirectory + abi + “/libil2cpp.so”,
“–cachedirectory=” + workingDir + “/build/il2cpp_”+ abi + “_” + configuration + “/il2cpp_cache”,
“–additional-include-directories=” + workingDir + “/src/main/Il2CppOutputProject/IL2CPP/external/bdwgc/include”,
“–additional-include-directories=” + workingDir + “/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/include”,
“–tool-chain-path=” + android.ndkDirectory,
“–map-file-parser=” + workingDir + “/src/main/Il2CppOutputProject/IL2CPP/MapFileParser/MapFileParser.exe”,
“–generatedcppdir=” + workingDir + “/src/main/Il2CppOutputProject/Source/il2cppOutput”,
“–baselib-directory=” + workingDir + “/src/main/jniStaticLibs/” + abi,
“–dotnetprofile=unityaot”)
environment “ANDROID_SDK_ROOT”, getSdkDir()
}
delete workingDir + targetDirectory + abi + “/libil2cpp.sym.so”
ant.move(file: workingDir + targetDirectory + abi + “/libil2cpp.dbg.so”, tofile: workingDir + “/symbols/” + abi + “/libil2cpp.so”)
}

I spent two days in exploring this issue but no fix found yet. Is there anyone who has a clue what to do to fix that problem? I really need to build my project these days.

Thanks in advance for every suggestion to fix that issue.

In 2020, Il2Cpp cpp files are placed inside gradle project when you do Export Project On, thus libil2pp.so is compiled when your gradle build is invoked. When you do Export Project Off, libil2cpp.so is compiled by Unity.

I haven’t seen your error before, so not sure why it fails, is that really the full log? Could you try to chmod your export folder rather than only il2cpp.exe? Alternatively try switching to 2020 LTS, since 2020.1 is no longer supported

Thanks for your fast reply. Export Project On is correct when I need to include Unity project into another app, is it?

Shall I check java version, jdk, sdk, ndk or some player settings in Unity? I really have no clue what to do further since I double checked each configuration several times.

I tried with chmod 744 on all files within folder unityLibrary recursively. Error code is 126 again:

Execution failed for task ‘:unityLibrary:BuildIl2CppTask’.

Process ‘command ‘/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe’’ finished with non-zero exit value 126

Stacktrace:

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:unityLibrary:BuildIl2CppTask’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:207)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:205)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:186)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    Caused by: org.gradle.process.internal.ExecException: Process ‘command ‘/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe’’ finished with non-zero exit value 126
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:417)
    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:38)
    at org.gradle.process.internal.DefaultExecActionFactory.exec(DefaultExecActionFactory.java:168)
    at org.gradle.groovy.scripts.DefaultScript.exec(DefaultScript.java:249)
    at org.gradle.api.Script$exec$0.callCurrent(Unknown Source)
    at build_8t4y0b846ugee1a7rj6rlftrj.BuildIl2Cpp(/Users/[path to app]/unityLibrary/build.gradle:130)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:484)
    at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
    at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:130)
    at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:77)
    at org.gradle.internal.metaobject.BeanDynamicObject$GroovyObjectAdapter.invokeOpaqueMethod(BeanDynamicObject.java:584)
    at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:511)
    at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
    at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:77)
    at build_8t4y0b846ugee1a7rj6rlftrj$_run_closure6$_closure22$_closure25.doCall(/Users/[path to app]/unityLibrary/build.gradle:155)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:669)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:642)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:569)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:554)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:537)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:278)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:267)
    at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
    at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
    at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
    at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
    at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
    at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
    at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
    at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
    at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
    at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
    at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
    at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
    at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:194)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:186)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

Try updating to 2020 LTS first and see if that fixes it, 2020.1 is no longer supported

After updating to 2020 LTS I found the failure: My build.gradle file was merged into a Windows version by git with my last pull. That caused multiple problems on my OS X system. Now we changed our gradle file so it can handle both OS. This problem ended in a newer version of Unity and an enhanced gradle file :wink:

Thanks for your support Thomas1856

1 Like

Hello,
I am having the same problem, could you share a gradle template that let me build the Android Studio project on both OS as well?

Having issues on 2021 engine versions, I assume this wasn’t fixed by Unity. Could you share your fix please?

FYI this is when exporting an android studio project to bundle into a native app, the whole thing works fine when doing the builds on Windows 10 but when we do the same process on MacOS there are errors about a missing il2cpp.exe in android studio when running the build.

@Tomas1856 I am running into the same issue as described above. I looked deeply into this and it looks like this has to do with cross-platform compatibility.

  1. When exporting an Android build from a Windows machine, and then at the time of making a build after merging the exported project with native client via Android studios, the build expects il2cpp.exe file with error:
    Execution failed for task ‘:unityLibrary:BuildIl2CppTask’.
    > A problem occurred starting process 'command '/Users/[path to app]/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/build/deploy/net471/il2cpp.exe

Therefore, the exported project builds fine on a Windows machine, but it does not build on a Mac (mac doesn’t support exe file, and its also not committing exe files into github due to it being excluded in gitignore_global.txt)

  1. If we reverse the situation: Export the Android project from a Mac, and integrate the project with the native client in Windows, it also doesn’t work. At the time of building it throws error:
    CreateProcess error=193, %1 is not a valid Win32 application

What worked:
However, if I export the Android project from Windows, and build from a Windows machine it works. Same if I export the Android project from Mac, and build from a Mac machine.

So the problem is strictly related to cross-platform OS builds. This appears to be a unity engine bug introduced in either 2020 or 2021. I am positive about this because we have been using Unity 2019.4.18f1 until now and exported project from Windows always worked on a Mac, and vice versa. So this appears to be a new limitation from the upgrade to Unity 2021.1.18f1.

Summary:
• Exported from Windows + Built from Windows machine => Works
• Exported from Windows + Built from Mac machine => Does not work
• Exported from Mac + Built from Mac machine => Works
• Exported from Mac + Built from Windows machine => Does not work

Any plans of fixing this soon?

1 Like

Hey, could you please submit a bug via Unity so our QA can have this on our radar, thank you !

@Tomas1856 Here is an update: the bug was reported a few weeks ago. I have been reached via email by the Unity QA team requesting more information. Will be responding soon, thanks

3 Likes

Are there some updates about that issue ? I am trying to generate an Android project exporting from Windows for a partner who works on Mac and it very hard to find a fluent process to make everything “buildable” on its Mac.

I am also facing an issue when Export Project is on. I have an existing native app, that was first created on windows, however I want to take this native app, and Export Project from Unity on MacOS.

I get an error:
Error: Your project contains C++ files but it is not using a supported native build system.

Its likely a different issue, but getting feedback to the issue written here may help.

Hi any update on the resolution of the mentioned bug? and how we can handle the situation where exporting project from Mac should work on linux. Thanks.

Last I heard there are internal discussions on how to approach this, but nothing concrete so far. If you want to build gradle project on Linux, you need to export from Unity Linux Editor.

Hi,
Just Ran into the same issue in Unity 2021.3.18f1 today, any update on when it will likely be fixed.

Currently this issue is treated as “By Design”, if you want - you can submit a feedback here - https://unity.com/roadmap/unity-platform/pipeline-integrations

Player Build Pipeline->Submit a new idea, that way il2cpp product management can reevaluate this item.