Error while evaluating property 'namespace' of task ':unityLibrary:FirebaseApp.androidlib:packageRel

Hi,

I have a unity project that could build fine in Unity 2021.3.11f1. After updating to 2022.3.17f1 I’m getting a gradle error and it won’t build. I have update Firebase to latest (11.6.0). But I can not squash this error.

At the end of the build a window pops open and shows this message:

Error while evaluating property 'namespace' of task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources' See the Console for details.

And below is the console error:

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources FAILED
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:mergeReleaseJniLibFolders
7 actionable tasks: 2 executed, 5 up-to-date

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Any tips?

Thanks!

The next console error after the one posted above:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources'.
> Error while evaluating property 'namespace' of task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources'
   > Failed to calculate the value of task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources' property 'namespace'.
      > Failed to query the value of property 'namespace'.
         > Manifest file does not exist: C:\Users\[redacted]\Desktop\Work\[redacted]\Repos\[redacted]\[Unity project name]\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\FirebaseApp.androidlib\AndroidManifest.xml
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

and third console error:

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2022.3.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
Environment Variables:
PROCESSOR_ARCHITECTURE = AMD64
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = [redacted]
BURST_ANDROID_MIN_API_LEVEL = 22
DriverData = C:\Windows\System32\Drivers\DriverData
USERDOMAIN = [redacted]
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
COMPUTERNAME = [redacted]
DEBUG_ENV_VAR = UnityHub
LOGONSERVER = \\[redacted]
AMPLITUDE_TOKEN_GREENBUCKET_PROD = [redacted]
PUBLIC = C:\Users\Public
ProgramData = C:\ProgramData
SESSIONNAME = Console
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = [redacted]
asl.log = Destination=file
KINECTSDK20_DIR = C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\
APPDATA = C:\Users\[redacted]i\AppData\Roaming
SystemRoot = C:\WINDOWS
windir = C:\WINDOWS
AMPLITUDE_API_KEY_REDBUCKET_DEV = [redacted]
ProgramFiles(x86) = C:\Program Files (x86)
ProgramW6432 = C:\Program Files
INTEL_DEV_REDIST = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
OS = Windows_NT
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
HEAP_CLIENT_TOKEN_STAGING = 3786794399
HOMEPATH = \Users\[redacted]
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_18988_NFJFGRISGURKRTDQ
MIC_LD_LIBRARY_PATH = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
CommonProgramFiles = C:\Program Files\Common Files
VS140COMNTOOLS = C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
USERDOMAIN_ROAMINGPROFILE = [redacted]
TEMP = C:\Users\[redacted]\AppData\Local\Temp
CommonProgramW6432 = C:\Program Files\Common Files
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = [redacted]
AMPLITUDE_API_KEY_GREENBUCKET_DEV = [redacted]
AMPLITUDE_API_KEY_REDBUCKET_PROD = [redacted]
HOMEDRIVE = C:
AMPLITUDE_API_KEY_STAGING = [redacted]
USERNAME = [redacted]
OneDrive = C:\Users\[redacted]\OneDrive
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = [redacted]
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
AMPLITUDE_TOKEN_REDBUCKET_PROD = [redacted]
OculusBase = C:\Program Files\Oculus\
NUMBER_OF_PROCESSORS = 8
GTK_BASEPATH = C:\Program Files (x86)\GtkSharp\2.12\
AMPLITUDE_TOKEN_GREENBUCKET_DEV = [redacted]
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = [redacted]
PROCESSOR_LEVEL = 6
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Intel\
AMPLITUDE_API_KEY_GREENBUCKET_PROD = [redacted]
ComSpec = C:\WINDOWS\system32\cmd.exe
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
PROCESSOR_REVISION = 5e03
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = [redacted]
TMP = C:\Users\dayvi\AppData\Local\Temp
SystemDrive = C:
AMPLITUDE_API_KEY = [redacted]
OneDriveConsumer = C:\Users\[redacted]\OneDrive
SENTRY_ACCESS_TOKEN = [redacted]
HEAP_CLIENT_TOKEN = [redacted]
ALLUSERSPROFILE = C:\ProgramData
Path = C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Users\dayvi\AppData\Local\Microsoft\WindowsApps;
ProgramFiles = C:\Program Files
LOCALAPPDATA = C:\Users\[redacted]\AppData\Local
USERPROFILE = C:\Users\[redacted]
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources'.
> Error while evaluating property 'namespace' of task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources'
   > Failed to calculate the value of task ':unityLibrary:FirebaseApp.androidlib:packageReleaseResources' property 'namespace'.
      > Failed to query the value of property 'namespace'.
         > Manifest file does not exist: C:\Users\[redacted]\Desktop\Work\[redacted]\Repos\[redacted]\[redacted]\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\FirebaseApp.androidlib\AndroidManifest.xml
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32
This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources FAILED
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:mergeReleaseJniLibFolders
7 actionable tasks: 2 executed, 5 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6542399aa1cb4f1c8de3e43116fd1b96>:0)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

I squashed the warning for compileSDK 33.

Now the first error is:

Starting a Gradle Daemon, 1 incompatible and 4 stopped Daemons could not be reused, use --status for details
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:xrmanifest.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources FAILED
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
> Task :unityLibrary:xrmanifest.androidlib:packageReleaseResources UP-TO-DATE
8 actionable tasks: 1 executed, 7 up-to-date

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

so is the issue this? → Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources FAILED

If so, any tips for fixing it?

There’s some gradling to be had at the bottom of this list. Firebase is always one of the most difficult packages to integrate, mostly because they tried to make it idiot proof by having it do all kinds of silent automation.

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:

1 Like

Thank you very much for all the very useful info! My Firebase errors where squashed by deleting the Library/Bee folder and the Assets/Plugins/Android folder

Excellent. Coincidentally your avatar icon looks a lot like my face when I’m trying to fix Firebase errors. :slight_smile:

9588220--1358272--Screenshot 2024-01-17 at 2.36.18 PM.png

1 Like

Ha!

Can you guide me?

What issue are seeing?

i had the error but i fixed this like
only delete files inside Plugins/Andorid and then do force resolve like
= Assets/ExternalDepencyManager/AndroidResolver/ForceResolve

1 Like

Hey there!
This issue is solved, but I wanted to give an input here. We were having this issue only in CI/CD development environments while building it locally gave us no hassle

:rotating_light:Be careful deleting .gradle

To mention, it is not always safe to simply remove your *.gradle files from the project Assets/Plugins/Android. There are some settings made on those files that can be dangerous to remove. So always keep a copy or backup of the previous file before re-generating it.

Backup made, you can then proceed with either of the following:

:firecracker:Nuke mode

As mentioned on this thread (thanks SpiderJones), simply removing the folder will prompt you to re-generate the files. When doing it so, you can see that the template itself will be changed with the missing code for grade process to run.

:bulb:Please note, you’ll only be prompted to re-generate any files if and ONLY IF you use External Dependency Manager from Google. Otherwise, you may need to manually trigger it from ProjectSettings/Player/Android/Build and toggle the checkbox for Custom ___ Gradle Template

This process was also mentioned in another thread by Unity Staff IGuscin (thanks a lot)

After the files were re-generated you can then proceed to build.

:male_detective:Safe Mode

If you have any code or custom solution inside the Assets/Plugins/Android, avoid going for Nuke mode.
You can, in this scenario:

  1. Re-generate the files
  2. Manually merge the missing code on the new template

Or you can add the following line on your build.gradle file:

// Android Resolver Exclusions End
android {
    namespace "com.unity3d.player"  <<<<< THIS ONE

    ndkPath "**NDKPATH**"
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

We were having this very issue on some projects in our CI/CD environment, and went with Safe Mode to take care of the bug. Hope this helps

Happy game-deveing :)

1 Like

Thank you so much! It works perfectly for me!

1 Like