Unity android build error ?

It gives an error due to this error while building. I can’t figure out how to fix it, I need help.

[CXX1405] error when building with cmake using C:\Games\Unity\TopBasketball\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\cpp\CMakeLists.txt: C++ build system [prefab] failed while executing: See the Console for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:unityLibrary:configureCMakeDebug[arm64-v8a]’.

Task :unityLibrary:preBuild UP-TO-DATE
Task :unityLibrary:preDebugBuild UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:preBuild UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:preDebugBuild UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:compileDebugAidl NO-SOURCE
Task :unityLibrary:packageDebugRenderscript NO-SOURCE
Task :unityLibrary:compileDebugAidl NO-SOURCE
Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
Task :unityLibrary:generateDebugResValues UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:writeDebugAarMetadata UP-TO-DATE
Task :unityLibrary:processDebugManifest UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:packageDebugRenderscript NO-SOURCE
Task :unityLibrary:mobilenotifications.androidlib:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:mobilenotifications.androidlib:generateDebugResValues UP-TO-DATE
Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:generateDebugResources UP-TO-DATE
Task :unityLibrary:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:generateDebugResources UP-TO-DATE
Task :unityLibrary:packageDebugResources UP-TO-DATE
Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:packageDebugResources UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:extractDeepLinksDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:processDebugManifest UP-TO-DATE
Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:parseDebugLocalResources UP-TO-DATE
Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:mergeDebugShaders UP-TO-DATE
Task :unityLibrary:compileDebugShaders NO-SOURCE
Task :unityLibrary:generateDebugAssets UP-TO-DATE
Task :unityLibrary:packageDebugAssets UP-TO-DATE
Task :unityLibrary:processDebugJavaRes UP-TO-DATE
Task :unityLibrary:bundleLibResDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:generateDebugRFile UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:compileDebugLibraryResources UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:compileDebugJavaWithJavac UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:mergeDebugShaders UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :launcher:preDebugBuild UP-TO-DATE
Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
Task :launcher:compileDebugAidl NO-SOURCE
Task :launcher:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:mobilenotifications.androidlib:compileDebugShaders NO-SOURCE
Task :unityLibrary:mobilenotifications.androidlib:generateDebugAssets UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:packageDebugAssets UP-TO-DATE
Task :launcher:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:processDebugJavaRes NO-SOURCE
Task :unityLibrary:mobilenotifications.androidlib:bundleLibResDebug NO-SOURCE
Task :launcher:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:mergeDebugJniLibFolders UP-TO-DATE
Task :launcher:checkDebugAarMetadata UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:mergeDebugNativeLibs NO-SOURCE
Task :launcher:generateDebugResValues UP-TO-DATE
Task :unityLibrary:mobilenotifications.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
Task :launcher:mapDebugSourceSetPaths UP-TO-DATE
Task :launcher:generateDebugResources UP-TO-DATE
Task :launcher:mergeDebugResources UP-TO-DATE
Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksDebug UP-TO-DATE
Task :launcher:processDebugMainManifest UP-TO-DATE
Task :launcher:processDebugManifest
Task :launcher:mergeDebugShaders
Task :launcher:compileDebugShaders NO-SOURCE
Task :launcher:generateDebugAssets UP-TO-DATE
Task :launcher:mergeDebugAssets
Task :unityLibrary:configureCMakeDebug[arm64-v8a] FAILED
Task :launcher:processDebugManifestForPackage
Task :launcher:compressDebugAssets
45 actionable tasks: 6 executed, 39 up-to-date

9541795--1347556--Failure.png

Please post/attach the Editor.log file after the build has failed. If you are unsure where to find it, refer to Unity - Manual: Log files

When editing your post, please use code tags for the output. This will ensure that the forum does not replace certain letters with emojis. For more information on using code tags, visit Using code tags properly

I added the error visually, how can I fix it?

How to troubleshoot build failures:

Obviously, if there is actionable data within the errors, fix those problems. Each error entry may have more information than can fit in the console log so select each error and read the expanded view below it.

If that gives you nothing worthwhile (look to Google! You’re never the first one!), then…

First, make a blank project with a single blank scene and prove that it builds successfully.

If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

Until you can build a blank project to the target platform, don’t fiddle with anything else.

Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

Most often things that prevent building are third-party libraries such as Firebase.

Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

Android build not building:

Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.

Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022 (edited on August 23, 2023 to include Android SDK 33…):

Android Gradle errors and other related stuff:

These did not correct errors

I did 2 things to fix it
Set Firewall to not auto contain for 15mins.
Set TargetSDK and MinSDK to something lower than i didnt have. and it automatically tried to download the highest version, and installed it correctly.

I think maybe unity thinks auto containment wont get in the way, or they think you already have it installed. either way is not right, every pc is different.

I ran into the same problem. How did you end up solving it?