Unity2020 android export project error when il2cpp copy fmod_register_static_plugins.cpp

Hi,
It seems always failed in our project when export android project with FMOD.
Unity Version:2020.2.1f1c1

Error logs:

Android PostProcess task "Compiling resources" took 1504.9192 ms
Android PostProcess task "GenerateIl2cppPlatformProviders" took 2.6792 ms
Invoking UnityLinker with response file. response.rsp contents: -out=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/tempStrip -x=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/../platform_native_link.xml -x=C:/Users/admin/AppData/Local/Temp/tmp4d43b265.tmp -x=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/TypesInScenes.xml -x=X:/branches/ClientStaging-2020/Assets/link.xml -x=X:/branches/ClientStaging-2020/Assets/FacebookSDK/link.xml -x=X:/branches/ClientStaging-2020/Assets/Firebase/Plugins/Crashlytics/link.xml -x="X:/branches/ClientStaging-2020/Assets/Plugins/I2/Text Animation/Scripts/Utils/link.xml" -x=X:/branches/ClientStaging-2020/Assets/Plugins/Sirenix/Assemblies/link.xml -x=X:/branches/ClientStaging-2020/Assets/Plugins/UnityPurchasing/script/link.xml -d=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp-firstpass.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Sirenix.OdinInspector.CompatibilityLayer.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Cinemachine.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.AdaptivePerformance.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Coffee.UIParticle.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.RenderPipelines.Universal.Runtime.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.Timeline.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.TextMeshPro.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/AlmostEngine.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.RenderPipelines.Core.Runtime.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/FMODUnity.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/FMODUnityResonance.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Unity.AdaptivePerformance.Samsung.Android.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Sirenix.Serialization.Config.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/DOTween.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/Facebook.Unity.Settings.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/I18N.dll --include-unity-root-assembly=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/I18N.West.dll --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed --editor-settings-flag=Development --rule-set=Conservative --editor-data-file=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed/EditorToUnityLinkerData.json --platform=Android --engine-modules-asset-file="C:/Program Files/Unity/Hub/Editor/2020.2.1f1c1/Editor/Data/PlaybackEngines/AndroidPlayer/modules.asset"
C:\Program Files\Unity\Hub\Editor\2020.2.1f1c1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe exited after 25973 ms.
C:\Program Files\Unity\Hub\Editor\2020.2.1f1c1\Editor\Data\Tools/InternalCallRegistrationWriter/InternalCallRegistrationWriter.exe exited after 531 ms.
Invoking il2cpp (via bee.exe) with arguments: --convert-to-cpp --emit-null-checks --enable-array-bounds-check --enable-deep-profiler --dotnetprofile="unityaot" --additional-cpp=X:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/armeabi-v7a/additionalCppFiles/ADJSubscription.h --baselib-directory="C:/Program Files/Unity/Hub/Editor/2020.2.1f1c1/Editor/Data/PlaybackEngines/AndroidPlayer\Variations\il2cpp\Development\StaticLibs\armeabi-v7a" --avoid-dynamic-library-copy --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2020.2.1f1c1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --additional-cpp="X:/branches/ClientStaging-2020/Assets/../Temp/fmod_register_static_plugins.cpp" --additional-cpp="X:/branches/ClientStaging-2020/Assets/Plugins/FMOD/src/Runtime/fmod_static_plugin_support.h"  --directory=X:/branches/ClientStaging-2020/Temp/StagingArea/assets/bin/Data/Managed --generatedcppdir=X:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/armeabi-v7a/il2cppOutput 
C:\Program Files\Unity\Hub\Editor\2020.2.1f1c1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe exited after 4662 ms.
Uploading Crash Report
Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.2.1f1c1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --useprebuiltbuildprogram --no-colors

stdout:
[             ] Require frontend run.  tundra.dag no longer valid. FileSignature timestamp changed: il2cpp_settings.json
[        0s] Executed build program. Created build graph with 4 nodes.
[           0s] Freezing tundra.dag.json into .dag (.dag file didn't exist)
[2/4        0s] Copy Additional C++ File X:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/armeabi-v7a/il2cppOutput/fmod_register_static_plugins.cpp" --additional-cpp
##### CommandLine
copy "X:\branches\ClientStaging-2020\Temp\fmod_register_static_plugins.cpp" --additional-cpp" "X:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\fmod_register_static_plugins.cpp" --additional-cpp" && copy /b "X:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\fmod_register_static_plugins.cpp" --additional-cpp" +,, "X:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\fmod_register_static_plugins.cpp" --additional-cpp" 
##### ExitCode
1
##### Output
�ļ�����Ŀ¼�������﷨����ȷ��

�Ѹ���         0 ���ļ���
*** Bee build failed (0.20 seconds), 1 items updated, 4 evaluated
stderr:
  at UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) [0x00190] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) [0x00060] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String generatedCppOutputDirectory) [0x000dc] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.Boolean platformSupportsManagedDebugging) [0x0039a] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditorInternal.IL2CPPBuilder.Run () [0x00123] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) [0x0001d] in <439f491f7d8844bea7734598426775aa>:0 
  at UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00204] in <5cf84f2cc5134566935b135856517214>:0 
  at UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00078] in <5cf84f2cc5134566935b135856517214>:0 
  at UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) [0x003cf] in <5cf84f2cc5134566935b135856517214>:0 
  at UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) [0x00001] in <5cf84f2cc5134566935b135856517214>:0 
  at UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) [0x000dc] in <439f491f7d8844bea7734598426775aa>:0 
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, String[], Boolean)
UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)

I checked this file is not exist while build.

I’ve fixed this, it was caused by another plugin which contains android-support-v4.jar, just delete the file and export is OK.

Thanks for letting us know about this - I’m glad to hear you’ve resolved it!

The copy command line in your original post looks corrupted - it has mismatched quotes and “–additional-cpp” arguments that shouldn’t be there.

Could you tell us the name of the other plugin that was causing the issue? It would be good to see if we can fix the incompatibility.

We used Firebase\Adjust\Facebook\Applovin and some other plugins. Some of it caused the error.
Additionaly I found the il2cpp copy command in ProjectSettings.asset such like:

additionalIl2CppArgs: --additional-cpp=“C:/branches/ClientStaging-2020/Assets/…/Temp/fmod_register_static_plugins.cpp”
–additional-cpp=“C:/branches/ClientStaging-2020/Assets/Plugins/FMOD/src/Runtime/fmod_static_plugin_support.h”

will failed on mac buid because the path format is error, If I submit the ProjectSettings.asset after build on windows.

Here is the another error log:

Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.2.2f1c1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --useprebuiltbuildprogram --no-colors

stdout:
[ ] Require frontend run. tundra.dag no longer valid. FileSignature timestamp changed: il2cpp_settings.json
[ 0s] Executed build program. Created build graph with 4 nodes.
[ 0s] Freezing tundra.dag.json into .dag (.dag file didn’t exist)
[BUSY 6s] Il2Cpp C:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput
[0/4 13s] Il2Cpp C:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput
[1/4 0s] Copy Additional C++ File C:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput/ADJSubscription.h
�Ѹ��� 1 ���ļ���

�Ѹ��� 1 ���ļ���
[2/4 0s] Copy Additional C++ File C:/branches/ClientStaging-2020/Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput/fmod_register_static_plugins.cpp" --additional-cpp

CommandLine

copy “C:\branches\ClientStaging-2020\Temp\fmod_register_static_plugins.cpp” --additional-cpp" “C:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput\fmod_register_static_plugins.cpp” --additional-cpp" && copy /b “C:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput\fmod_register_static_plugins.cpp” --additional-cpp" +, “C:\branches\ClientStaging-2020\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput\fmod_register_static_plugins.cpp” --additional-cpp"

ExitCode

1

Output

�ļ�����Ŀ¼�������﷨����ȷ��

�Ѹ��� 0 ���ļ���
*** Bee build failed (13.95 seconds), 3 items updated, 4 evaluated
stderr:

UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <2acd8ded843c4ca4ba391f3fdbb7d6a5>:0)

I have now managed to reproduce and fix this issue. The fix will be in the next release, which should be available soon.

This issue should also be fixed in the next release.

Nice!
Thanks very much. Just waiting~~ :stuck_out_tongue_closed_eyes:

FMOD version 2.01.08, which includes these fixes, is now available from https://fmod.com/download.

I am running Unity 2020.2 and am a new user to FMOD. I was using FMOD version 2.01.07 and couldn’t build my project.

Today I updated to FMOD version 2.01.08 in hopes of fixing a IL2cpp build error I experienced when FMOD is in my project. However sadly it is not fixed.

Removing FMOD allows the project to build as normal.

Here is the copied stack and source:

[Exception] Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2020.2.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @“C:\Users\Justin\AppData\Local\Temp\tmpEB4B.tmp” -o “C:\ProjectName\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_CEF5D57C624D1976965A2DB8343B534B\libil2cpp.so” -shared -Wl,-soname,libil2cpp.so -Wl,–no-undefined -Wl,-z,noexecstack -Wl,–gc-sections -Wl,–build-id -stdlib=libc++ -static-libstdc++ -target aarch64-linux-android21 -Wl,–wrap,sigaction “C:\Program Files\Unity\Hub\Editor\2020.2.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\StaticLibs\arm64-v8a\baselib.a” -llog -rdynamic -fuse-ld=bfd.exe
clang++.exe. error. linker command failed with exit code 1()

at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles()

at Unity.IL2CPP.Building.CppProgramBuilder.Build()

at il2cpp.Compilation.CompilationDriver.Run()

at il2cpp.Program.DoRun()

Runner.RunProgram() at :0

Runner.RunManagedProgram() at :0

IL2CPPBuilder.RunIl2CppWithArguments() at :0

IL2CPPBuilder.ConvertPlayerDlltoCpp() at :0

IL2CPPBuilder.Run() at :0

IL2CPPUtils.RunIl2Cpp() at :0

RunIl2Cpp.Execute() at :0

PostProcessRunner.RunAllTasks() at :0

PostProcessAndroidPlayer.PostProcess() at :0

AndroidBuildPostprocessor.PostProcess() at :0

PostprocessBuildPlayer.Postprocess() at :0

GUIUtility.ProcessEvent()