Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[ANSWERED] Unity 2019.1.9f1: Cannot build android projects with IL2CPP enabled

Discussion in 'Editor & General Support' started by Toastbyte, Jul 10, 2019.

  1. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    54
    EDIT: Mono scripting backend works fine.

    Hello,

    Since from August 1st apps on Playstore are required to have 64-bit support, I want to update my android apps to support 64-bit architectures by changing the scripting backend from Mono to IL2CPP in the Project settings.

    upload_2019-7-10_20-14-48.png

    With everything selected and after clicking "Build" the following errors appear in the console.

    I tried building on an empty project with a fresh installation of Unity 2019.1.9f1 and even reinstalled Visual Studio 2017 and Visual Studio 2019 on my PC. I also tried other Unity versions such as: 2019.2.0b7 and 2019.3.0a8.

    I installed everything through Unity Hub as is recommended.

    Help would be greatly appreciated. What am I missing?


    Errors:

    upload_2019-7-10_20-20-53.png
    (

    Failed running C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp/build/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:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\Users\John\Documents\Projects\Test\test\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2018.3.0f2/2019.1.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2018.3.0f2/2019.1.9f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=C:/Users/John/Documents/Projects/Test/test/Temp/StagingArea/assets/bin/Data/Managed --generatedcppdir=C:/Users/John/Documents/Projects/Test/test/Temp/StagingArea/Il2Cpp/il2cppOutput
    stdout:
    Building libil2cpp.so with AndroidToolChain
    Output directory: C:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
    Cache directory: C:\Users\John\Documents\Projects\Test\test\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from C:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\Il2Cpp\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp:72:
    In file included from C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity\AtomicQueue.cpp:6:
    In file included from C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps.h:121:
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:622:17: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:653:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:690:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:724:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:755:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r0", "r1", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:793:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:833:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:875:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:917:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    9 errors generated.
    Invocation was: Executable: "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++"
    Arguments: -DNET_4_0 -DUNITY_AOT -DGC_NOT_DLL -DRUNTIME_IL2CPP -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\external\bdwgc\include" -I"." -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\llvm-libc++\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\llvm-libc++abi\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\android\support\include" -c -g -DNDEBUG -fexceptions -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++98 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fPIC -Os --sysroot "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sysroot" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -isystem "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sysroot\usr\include\arm-linux-androideabi" -D__ANDROID_API__=16 -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -Wno-unused-value "C:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\Il2Cpp\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp" -o "C:/Users/John/Documents/Projects/Test/test/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/69A3015F0A286C34AA6224074AFEF3E0.o"
    at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    stderr:
    Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from C:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\Il2Cpp\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp:72:
    In file included from C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity\AtomicQueue.cpp:6:
    In file included from C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps.h:121:
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:622:17: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:653:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:690:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:724:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:755:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r0", "r1", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:793:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:833:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:875:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:917:27: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "memory", "r2", "r3"
    ^
    9 errors generated.
    Invocation was: Executable: "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++"
    Arguments: -DNET_4_0 -DUNITY_AOT -DGC_NOT_DLL -DRUNTIME_IL2CPP -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp\external\bdwgc\include" -I"." -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\llvm-libc++\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\llvm-libc++abi\include" -I"C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\android\support\include" -c -g -DNDEBUG -fexceptions -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++98 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fPIC -Os --sysroot "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sysroot" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -isystem "C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sysroot\usr\include\arm-linux-androideabi" -D__ANDROID_API__=16 -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -Wno-unused-value "C:\Users\John\Documents\Projects\Test\test\Temp\StagingArea\Il2Cpp\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp" -o "C:/Users/John/Documents/Projects/Test/test/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/libil2cpp/69A3015F0A286C34AA6224074AFEF3E0.o"
    at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:496)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(String, String, String, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:477)
    UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)



    -----------


    Exception: C:\Program Files\Unity\Hub\Editor\2018.3.0f2\2019.1.9f1\Editor\Data\il2cpp/build/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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:496)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.String inputDirectory, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:477)
    UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
    UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <1a10f9035b6b403994c99e5b653643c6>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    )
     
    Last edited: Jul 11, 2019
  2. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    116
  3. MoisesCT

    MoisesCT

    Joined:
    Mar 16, 2017
    Posts:
    3
    Hi @Toastbyte, I have the same error even when I disabled the x86 architecture and il2cpp is active.

    I think is something related with the cache created of previous builds, but It would be good if someone from Unity helps.

    Greetings
     
  4. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    116
    Hello @MoisesCT , but you still haven't solve the issue right? Because either enable x86 or disable x86 doesn't make any changes.
     
  5. MoisesCT

    MoisesCT

    Joined:
    Mar 16, 2017
    Posts:
    3
    @BoatBest Hi, not yet. I have two versions of Unity 2019.1 (2019.1.9f1 - 2019.1.1f1), I will try uninstalling both of them and installing only the latest one (2019.1.9f1)

    I'll see what happens.
     
  6. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    116
    @MoisesCT Okay sure! Please tell what happens too! For me I only have one version which is 2019.1.9f1 but yesterday before I upgrade to this version I use 2019.1.8f with no error. Headache about this bug hahaha
     
    mahmoud93p likes this.
  7. lgksg

    lgksg

    Joined:
    Jun 12, 2019
    Posts:
    1
    Same issue !
     
    mahmoud93p likes this.
  8. whatzzz

    whatzzz

    Joined:
    Jan 7, 2018
    Posts:
    2
    I have exactly the same problem. This is so frustrating.
     
    mahmoud93p likes this.
  9. dreipol

    dreipol

    Joined:
    Jul 20, 2015
    Posts:
    3
    Same problem, disable armv7 worked for me
     
    Last edited: Jul 11, 2019
    mahmoud93p likes this.
  10. josip112001

    josip112001

    Joined:
    Apr 8, 2015
    Posts:
    3
    Same problem here. I was able to make only ARM64 (disabling ARMv7 and x86) by disabling Strip Engine Code option in Optimization part of Settings
     
    habiba1611146 likes this.
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,912
    This seems rather odd, we're getting a number of reports of something like this. Can anyone let me know which NDK version(s) are being used when this happens? Building for armv7 should work fine.
     
  12. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    My project was working, but because I want to use the Android SDK and NDK tools recommended by Unity in the Hub section. Now I get this error. I need make updates in my games and is very frustrating for me. I hope we can solve it soon

     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,912
    It seems the image you provided is not available. Can you mention the specific NDK version you are using?
     
  14. josip112001

    josip112001

    Joined:
    Apr 8, 2015
    Posts:
    3
    NDK installed with Unity 2019.1.9f1

    Pkg.Desc = Android NDK
    Pkg.Revision = 19.1.5304403
     
    Last edited: Jul 11, 2019
    gferrari likes this.
  15. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I resolve the issue when I download by my own the NDK r16b and using my SDK too in External Tools settings. I don't know why I can´t use the "recommended android NDK".
     
    Voxel-Busters likes this.
  16. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,946
    Please open */Unity/Hub/Editor/2019.1.*/Editor/PlaybackEngines/AndroidPlayer/NDK/source.properties and share it here.

    We are on 2019.1.7f1 and don't see any kind of this error. But our customers reported it they see this error.

    Mine is
    Pkg.Desc = Android NDK
    Pkg.Revision = 16.1.4479499
     
  17. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Pkg.Desc = Android NDK
    Pkg.Revision = 19.1.5304403
     
  18. whatzzz

    whatzzz

    Joined:
    Jan 7, 2018
    Posts:
    2
    Thanks, it worked!
    Can't believe this took me whole day...
     
    gferrari likes this.
  19. LordBelasco

    LordBelasco

    Joined:
    May 1, 2017
    Posts:
    29
    I have the same problem. I always use the Android NDK installed by the Unity Hub
    I switch back my project to Unity 2019.1.8f1, and it's ok
    Remember to always keep the previous Unity release ;)
     
    gferrari likes this.
  20. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    54
    Why would you download the r16b NDK when r20 is already out? (from https://developer.android.com/ndk/downloads)
    upload_2019-7-11_16-55-19.png
     
  21. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi, Because r16b work and was suggest in the "download" link in the external tools when I use Unity 2018.4, the last NDK don't work with my 2019.1.9f1. I will try again. It work for you in the last version of Unity?
     
  22. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    54
    What I take from your answers is that in the current Unity build (2019.1.9f1) it is not possible to build with IL2CPP, because of those errors. For that reason I have to manually download the (r16b) NDK and the newest SDK and manually link them in the preferences.

    It still doesn't work for me though. When I try to click on "Browse" next to NDK in the external tools in project preferences, nothing happens. Do you have the same problem? Maybe it has to do something with the errors.

    upload_2019-7-11_17-23-2.png

    Even when I put in my own path in the textbox and try building the project, it automatically changes to the path above.

    I'm using NDK Pkg.Revision = 19.1.5304403 by the way.
     
  23. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I have Unity 2019.1.9f1

    1) I download android-ndk-r16b-windows-x86_64.zip from https://developer.android.com/ndk/downloads/older_releases.html

    2) Uncompressed here C:\Program Files\android-ndk-r16b

    3) Setup my Unity Preferences
    aa.PNG
    I have all Architectures in my list from Project Settings
    bb.PNG

    And it work for me and I can continue working on my game. But I want use the Officially supported. So I will wait some answer to resolve this. But now I'm more relaxed o_O:). I hope I have helped someone.
     
    Last edited: Jul 11, 2019
  24. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    54
    Quickly wanted to say thank you. It finally worked.
    I finally managed to manually link the NDK in the preferences to the newest r20 NDK version and then it worked.

    The issue is resolved by doing this, but the errors still exist when using the recommended unity hub NDK.
     
    gferrari likes this.
  25. Sevdanski

    Sevdanski

    Joined:
    Nov 14, 2013
    Posts:
    5
    I'm also having a number of similar problems. I installed 2019.1.9 yesterday, and switched it over to IL2CPP so that I could export a 64-bit android build.

    Like many above, I can get it to build the 64-bit version, but the build dies if I have armv7 checked.

    I have attempted to manually change the NDK but the browse button does not work. If I manually edit the path it appears to revert.

    I have attempted to go back to earlier versions - most recently 2019.1.8 and have similar problems. If I attempt to change the NDK there I have the same problem with the brose button and the NDK path appears to be pointing at the 2019.1.9 version.

    I am currenly in the process of removing all installations and starting again.

    -----

    Update - I did manage to get it to work by downloading the Android NDK, Revision 16b and pointing Unity at it.

    The browse refused to work until I removed unity's ndk. Once the existing path was invalid it began working again.

    As for the 'reverting' of the path - it seems to do that if you have put in a path do an unsupported NDK. I had pasted in a path to a revision 20 version and it reverted back. When I selected the same version via the browse button it gave me a warning that it was not a supported version.
     
    Last edited: Jul 12, 2019
  26. zeekindustries

    zeekindustries

    Joined:
    Jun 4, 2010
    Posts:
    19
    Hey guys, just my two cents here.

    I've been going through the same issue for the past week. Everything was working fine with my project, but I had to format my machine.

    So, fresh Windows, fresh Unity, download and install 2019.1.8f1 with all the Android modules, I'm building a mobile VR app with Vuforia. Cloned my repo, tried to build, these errors come in. Have to say that it was working with no problem before I formatted my machine.

    I can confirm that the problem lies somewhere in the NDK version, tried previous versions of the NDK from r20 all the way down to the r16b which was the only one that succeded in building. I had to copy paste manually the path of the NDK until r16b worked, browse button wasn't working either.

    ...and then something happened. After building with r16b and pressed the browse button (wanted to tried that because when I did it previously it always resets to the NDK within the Unity Editor) I got the window to properly choose a path, went and tried to assing r20 and Unity throwed an exception that reads

    NDK 20.0.5594570 detected. Unity requires NDK r16b (64-bit) (16.1.4479499)

    You can see my settings here:

    UnityAndroid_00.PNG UnityAndroid_01.PNG UnityAndroid_02.PNG
     
  27. zeekindustries

    zeekindustries

    Joined:
    Jun 4, 2010
    Posts:
    19
    Maybe it's an ENV variable related issue?
     
  28. tuncturel

    tuncturel

    Joined:
    Jul 20, 2012
    Posts:
    47
    Hi!

    This worked for us! We only needed to download the android-ndk-r16b. The ndk on Unity must be the problematic one.

    Thank you soooo much!
     
    gferrari likes this.
  29. Kirkules_

    Kirkules_

    Joined:
    Aug 5, 2014
    Posts:
    65
    Turned off Strip Engine Code and it built.

    Here's the error I was getting before turning off Strip Engine Code:
    C:/Program Files/Unity/Hub/Editor/2019.1.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld.bfd.exe: cannot find -lgnustl_static
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

    Full Error:

    CommandInvokationFailure: Failed to link 'libunity.so'.
    C:/Program Files/Unity/Hub/Editor/2019.1.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe @"Temp/StagingArea/strip/arm64-v8a/libunity.rsp"
    stderr[
    C:/Program Files/Unity/Hub/Editor/2019.1.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld.bfd.exe: cannot find -lgnustl_static
    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
    ]
    stdout[
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildSharedLibrary.Link (UnityEditor.Android.PostProcessor.PostProcessorContext context, UnityEditor.Android.AndroidNDKTools ndk, UnityEditor.Android.AndroidTargetDeviceType deviceType, System.Collections.Generic.IEnumerable`1[T] objects) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildSharedLibrary.Build (UnityEditor.Android.PostProcessor.PostProcessorContext context, UnityEditor.Android.AndroidNDKTools ndk, UnityEditor.Android.AndroidTargetDeviceType deviceType) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildSharedLibrary.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <1a10f9035b6b403994c99e5b653643c6>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Jul 12, 2019
  30. AlenBrk

    AlenBrk

    Joined:
    Feb 17, 2014
    Posts:
    33
    Thx for the Info, but didn't work for me..
     
  31. Caesoose

    Caesoose

    Joined:
    Jul 9, 2013
    Posts:
    2

    You sir are a legend! Spent the last few days driving myself insane trying to fix this, and you've come along and solved it! Thank you so much
     
    memin11, mahmoud93p and gferrari like this.
  32. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Same problem here. bit annoying. Fresh install 2019.1.9f1, all Unity's favoured NDK and JDK, should just work no!



    Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from I:\unity_projects\TestFPS\UnityFPSTest\Temp\StagingArea\Il2Cpp\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp:72:
    In file included from C:\Program Files\Unity\Hub\Editor\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity\AtomicQueue.cpp:6:
    In file included from C:\Program Files\Unity\Hub\Editor\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps.h:121:
    C:\Program Files\Unity\Hub\Editor\2019.1.9f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:622:17: error: asm-specifier for input or output variable conflicts with asm clobber list
    : "cc", "r2", "r3"
    ^
     
  33. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Exactly same problem with 2019.1.10f1
     
  34. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Same thing here: click browse: doesn't work! Come on!!
    Edit: As mentioned: deleting the NDK from: C:\Program Files\Unity\Hub\Editor\2019.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer made the browse function work. However I haven't been able to resolve by using another NDK
     
    Last edited: Jul 13, 2019
    Krishan04 likes this.
  35. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    Which SDK have you got installed?
     
  36. SpiderJones

    SpiderJones

    Joined:
    Mar 29, 2014
    Posts:
    242
    Any update from Unity? My app installs fine with 2019.1.9f1, but I get the original poster's error when using 2019.1.10f1. I rolled the project back to 201.1.9f1 and it builds fine. Then updated it again to 2019.1.10f1, it had the same issue.
     
  37. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    164
    Thanks a lot for the tip @gferrari. Manually installing the NDK worked for me as well!
     
  38. gazram

    gazram

    Joined:
    Sep 18, 2017
    Posts:
    3
    we have successfully built to android using arm64, x86 in 2019.1.10f1 by turning off "strip engine code" without downloading NDK manually
     
  39. SpiderJones

    SpiderJones

    Joined:
    Mar 29, 2014
    Posts:
    242
    Turning off "strip engine code" did not work for us unfortunately. Have not trying downloading NDK yet.

    But, turning off "strip engine code" and only building to ARM64 did work. The same for x86. But can not build to ARMv7.

    Turned on "strip engine code" and tried to build for ARM64, got an error message popup that said, "Failed to link 'libunity.so'. See the console for details."

    I'm using 2019.1.10f1

    I shared my console error here (this is when using strip engine code) -> https://forum.unity.com/threads/2019-1-10f1-wont-build-to-android-device.709610/#post-4743593
     
    Last edited: Jul 13, 2019
  40. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    I have same. But I've tried various versions now: e.g. 2019.1.6f1,
    All same issue: can't build Armv7

    I've faffed around as some have suggested, but using a downloaded NDK creates other errors:

    Il2CppCompilerCalculateTypeValues.cpp:10:10: fatal error: 'cstring' file not found

    #include <cstring>

    ^~~~~~~~~

    1 error generated.
    Il2CppCompilerCalculateTypeValues.cpp:10:10: fatal error: 'cstring' file not found

    #include <cstring>

    ^~~~~~~~~

    1 error generated.
     
  41. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    48
    I've now found downloading and using NDK r16b does in fact fix this (something was awry with my installation of it - no idea why)

    I found it's ONLY the NDK that needs to be changed. Can use Unity's JDK, Android SDK fine.
     
  42. G3nko0

    G3nko0

    Joined:
    Oct 1, 2016
    Posts:
    12
    Just pasting path to NDK v16b in Unity Preferences->External Tools-> Android NDK instead of the recommended one fixed the issue.

    Note: button browse didn't work for me, Unity version 2019.1.10f, OS-X Mojave
     
    Last edited: Jul 14, 2019
    gferrari and Caesoose like this.
  43. motorious

    motorious

    Joined:
    Jun 25, 2016
    Posts:
    11
    This occurs even with an empty project. I filed bug 1169637 about it.
     
  44. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    Same problem after installing 2019.1.10f on OS-X Mojave,

    It looks like new Unity installations (hub) installs NDK 19.1.5304403 instead of previous 16.1.4479499 which causes the problem.

    Also re-installing Unity does not solve the issue as it still installs the newer NDK. I've tried reverting back 2019.1.9f which didn't work. So I've removed and reverted back to 2019.1.9f using Time Machine restore which also brings back the correct NDK.

    Currently I'm using 2019.1.10f with manually pointing the directly of previous NDK and it's working correctly.

    As noted above you can also manually install android-ndk-r16b and point Unity to it instead.
     
    gferrari likes this.
  45. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    Have the same issue since upgrading to version 2019.1.10f1. Again, downloading and pointing to version NDK v16b fixed the problem. My versions are below:

    UNITY 2019.1.10f1
    Pkg.Desc = Android NDK
    Pkg.Revision = 19.1.5304403

    UNITY 2019.1.9f1
    Pkg.Desc = Android NDK
    Pkg.Revision = 16.1.4479499
     
  46. madleen_unity

    madleen_unity

    Unity Technologies

    Joined:
    Aug 28, 2018
    Posts:
    17
    Hi!
    Just wanted to let you know that this is on our list and will be looked at very soon! I will keep you all updated here. For now, the workaround mentioned above of manually downloading the NDK will definitely help to make successful builds.
     
  47. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    agmaster likes this.
  48. madleen_unity

    madleen_unity

    Unity Technologies

    Joined:
    Aug 28, 2018
    Posts:
    17
    Just wanted to update you all that the issue is marked as fixed now and should be now working. Please upgrade to Unity Hub 2.0.4 for that (it seems to

    @SketchWork I believe it was not mentioned as it was not intended to be going up. It should be now downloading correctly r16b again.
     
  49. Deaymon

    Deaymon

    Joined:
    Apr 22, 2015
    Posts:
    2
    How do we remove the newest NDK that gives the error? Do we just erase the NDK folder? Unity Hub doesn't seem to have the option to remove modules.
    EDIT: Uninstalled and reinstalled Unity 2019.1.10f1 through Unity Hub 2.0.4. The error keeps happening, still can't choose own NDK through Preferences > External Tools because "Browse..." button does nothing.
     
    Last edited: Jul 20, 2019
  50. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    "Browse" button not working can be worked around by copy-pasting the exact path to a functioning NDK first - if you type in anything else and leave focus off the text field, it will attempt to validate, and if it's an incomplete path OR a bugged path to the pre-set NDK version other than 16b it will simply revert to its previous (assumed valid) state, still pointing to the bugged non-16b-NDK path.

    Also confirm that it's impossible to remove modules via Unity Hub, it only installs modules, and once installed they're displayed as disabled/greyed-out checkboxes in the module list.

    Haven't yet confirmed whether 2.0.4 is able to download the NDK 16b version correctly.