videokit-ai/natstep

Error with IL2CPP

Closed this issue · 2 comments

Greetings,
I'm getting the following error when building the app with IL2CPP selected.
Any ideas why this is happening and what should be done in order to fix it?

`Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --no-colors --prebuiltbuildprogram="C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\il2cpp/build/BeeSettings/offline/artifacts/buildprogram/buildprogram.exe"

stdout:
[ ] Require frontend run. tundra.dag no longer valid. FileSignature timestamp changed: il2cpp_settings.json
[ 0s] Executed build program. Created build graph with 2 nodes.
[ 0s] Freezing tundra.dag.json into .dag (.dag file didn't exist)
[BUSY 6s] Il2Cpp E:/UnityProjects/Project/Library/Il2cppBuildCache/Android/arm64-v8a/Native/arm64-v8a/libil2cpp.so
[0/2 8s] Il2Cpp E:/UnityProjects/Project/Library/Il2cppBuildCache/Android/arm64-v8a/Native/arm64-v8a/libil2cpp.so

CommandLine

"C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\il2cpp/build/deploy/netcoreapp3.1/il2cpp.exe" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARM64" --configuration="Release" --outputpath="E:\UnityProjects\Project\Library\Il2cppBuildCache\Android\arm64-v8a\Native\arm64-v8a\libil2cpp.so" --cachedirectory="E:\UnityProjects\Project\Assets..\Library\il2cpp_android_arm64-v8a/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2020.3.35f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2020.3.35f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --additional-libraries="E:/UnityProjects/Project/Assets/Plugins/Pedometer/Plugins/iOS/libPedometer.a" --baselib-directory="C:/Program Files/Unity/Hub/Editor/2020.3.35f1/Editor/Data/PlaybackEngines/AndroidPlayer\Variations\il2cpp\Release\StaticLibs\arm64-v8a" --avoid-dynamic-library-copy --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2020.3.35f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --incremental-g-c-time-slice=3 --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2020.3.35f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --generatedcppdir=E:/UnityProjects/Project/Library/Il2cppBuildCache/Android/armeabi-v7a/il2cppOutput --stats-output-dir=E:/UnityProjects/Project/Library/Il2cppBuildCache/Android/armeabi-v7a/il2cppStats --dotnetprofile="unityaot"

ExitCode

4

Output

Building libil2cpp.so with AndroidToolChain

Output directory: E:\UnityProjects\Project\Library\Il2cppBuildCache\Android\arm64-v8a\Native\arm64-v8a

Cache directory: E:\UnityProjects\Project\Library\il2cpp_android_arm64-v8a\il2cpp_cache

ObjectFiles: 519 of which compiled: 0

Total compilation time: 652 milliseconds.

Error: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\Sebastijan\AppData\Local\Temp\tmpC16.tmp" -o "E:\UnityProjects\Project\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_750536144EA223428C7430F8D9C54B0D\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 "E:\UnityProjects\Project\Assets\Plugins\Pedometer\Plugins\iOS\libPedometer.a" "C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\StaticLibs\arm64-v8a\baselib.a" -llog -rdynamic -fuse-ld=bfd.exe

E:\UnityProjects\Project\Assets\Plugins\Pedometer\Plugins\iOS\libPedometer.a: file not recognized: File format not recognized

clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)

at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)

at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)

at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
*** Bee build failed (8.11 seconds), 1 items updated, 2 evaluated
stderr:

UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at :0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <bfe26bbc7be749c7bb22d52435e15888>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action1[T] setupStartInfo) (at <bfe26bbc7be749c7bb22d52435e15888>:0) UnityEditorInternal.IL2CPPBuilder.RunCompileAndLink (System.String il2cppBuildCacheSource) (at <bfe26bbc7be749c7bb22d52435e15888>:0) UnityEditorInternal.IL2CPPUtils.RunCompileAndLink (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, System.String il2cppBuildCacheSource) (at :0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
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) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
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) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
`

Removing the iOS lib file while building on android fixed the issue..

I'll work on a proper fix for this. Thanks for bringing it up.