Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by simpleonegame · Jul 11, 2020 at 08:11 AM · build-erroril2cpp

il2cpp did not run properly while making unity build after facebook integration

Hello! My project was running all fine and I was able to make builds for android. But I could not make a build after facebook was integrated. It throws following errors. I googled the issue and found NDK could be a problem. I've updated NDK to ndk r19 and manually pointed the NDK location in external tools..did not work. Then deleted everything in the default NDK location (downloaded by unity hub) and copied all the files from ndk r19 to this location, still no luck.

Please help:

Here are the errors:

Error1: Failed running C:\Program Files\Unity\Hub\Editor\2019.3.6f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\Work\GameDev\Slow Mo Hero\Time Master\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2019.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.3.6f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Work/GameDev/Slow Mo Hero/Time Master/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="C:/Work/GameDev/Slow Mo Hero/Time Master/Temp/StagingArea/Il2Cpp/il2cppOutput"

stdout: Building libil2cpp.so with AndroidToolChain Output directory: C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a Cache directory: C:\Work\GameDev\Slow Mo Hero\Time Master\Library\il2cpp_android_armeabi-v7a\il2cpp_cache ObjectFiles: 224 of which compiled: 0 Total compilation time: 310 milliseconds. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\apurb\AppData\Local\Temp\tmp4F4C.tmp" -o "C:\Work\GameDev\Slow Mo Hero\Time Master\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_5618BF69E66A68B7EB33AE2F73D56763\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-libstdc++ -target armv7-linux-androideabi19 -Wl,--wrap,sigaction -llog -rdynamic -fuse-ld=gold.exe

C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:426: error: undefined reference to 'init' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:454: error: undefined reference to 'logout' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:454: error: undefined reference to 'logout' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:464: error: undefined reference to 'activateApp' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:464: error: undefined reference to 'activateApp' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:488: error: undefined reference to 'logPurchase' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:518: error: undefined reference to 'ui' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:540: error: undefined reference to 'initScreenPosition' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:540: error: undefined reference to 'initScreenPosition' 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.Program.DoRun(String[] args, List`1 foundAssemblies) at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture) at il2cpp.Program.Main(String[] args) stderr:

Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\apurb\AppData\Local\Temp\tmp4F4C.tmp" -o "C:\Work\GameDev\Slow Mo Hero\Time Master\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_5618BF69E66A68B7EB33AE2F73D56763\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-libstdc++ -target armv7-linux-androideabi19 -Wl,--wrap,sigaction -llog -rdynamic -fuse-ld=gold.exe

C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:426: error: undefined reference to 'init' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:454: error: undefined reference to 'logout' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:454: error: undefined reference to 'logout' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:464: error: undefined reference to 'activateApp' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:464: error: undefined reference to 'activateApp' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:488: error: undefined reference to 'logPurchase' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:518: error: undefined reference to 'ui' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:540: error: undefined reference to 'initScreenPosition' C:\Work\GameDev\Slow Mo Hero\Time Master\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.Canvas.cpp:540: error: undefined reference to 'initScreenPosition' 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.Program.DoRun(String[] args, List`1 foundAssemblies) at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture) at il2cpp.Program.Main(String[] args)

UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean) UnityEditorInternal.IL2CPPBuilder:Run() UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Error 2: Exception: C:\Program Files\Unity\Hub\Editor\2019.3.6f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly! 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.Action`1[T] setupStartInfo) (at :0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at :0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at :0) UnityEditorInternal.IL2CPPBuilder.Run () (at :0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (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)

Error 3: Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Error 4: UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JoshPeterson · Jul 15, 2020 at 11:12 AM

This failure occurs because the code in the project has extern methods in C#. Methods marked as extern with a the [Dllimport("__Internal")] attribute must be present in a native library that is linked with the Unity player when building with the IL2CPP scripting backend.

For example, this in this project one function which causes this issue is named: init

You have two options:

  1. Build a native library with all of the methods marked as extern with the [Dllimport("__Internal")] attribute for the target platform and architecture of the player. See this documentation for details about native plugins: https://docs.unity3d.com/Manual/NativePlugins.html

  2. Remove the C# code which defines this extern method. You can do that with platform dependent compilation: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

In this case, it might mean that you need to update the Facebook SDK. It looks like it does not support Android on IL2CPP.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

131 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unitylinker build error for UWP 0 Answers

IL2CPP Android Build Failure 5.5.0p3 1 Answer

Can't use System.Net.Sockets on Nintendo Switch 1 Answer

IL2CPP Android Development Build not detected 0 Answers

unity 5.2.4 iOS build error ,iOS build error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges