firebase-unity-sdk
firebase-unity-sdk copied to clipboard
UnityEditor.AndroidManifest.SetFixedWindowSize Error on build when Firebase Messaging is added
Every time I add Firebase Messaging SDK to my project and build it on Android, it fails and returns the error below. I have Firebase Auth, Firestore, and Storage on my project. This error only shows up when I add Firebase Messaging. I tried opening a previous version of my project and creating an empty project. The error only occurs when Firebase Messaging SDK is added.
How can I fix this?
NullReferenceException: Object reference not set to an instance of an object UnityEditor.AndroidManifest.SetFixedWindowSize (System.String activity, System.Int32 defaultWidth, System.Int32 defaultHeight, System.Int32 minimumWidth, System.Int32 minimumHeight) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.PatchLibraryManifest (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String manifest) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0) UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>: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 <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>: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 <3e401efa0ce4422582abd640a807e261>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Firebase Unity SDK Version
11.6.0
Unity editor version
2020.3.47f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
Messaging
Other Firebase Component(s) in use
Authentication, Firestore, Storage
Additional SDKs you are using
No response
Targeted Platform(s)
Android
Unity editor platform
Windows
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @JustGerome,
Could you provide the complete steps you've taken to reproduce this issue? A NullReferenceException
is usually caused by a script that tries to access a variable that doesn't reference an object. I haven't replicated this behavior so far given the information you provided.
Additionally, could you confirm if using the latest SDK version make any difference?
I think I have solved it for now. Since I added Messaging to my application my AndroidManifest.xml file is not including screen size so I added the code below and now the build is proceeding.
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
Still have no idea how this happened.
Thanks for following up. Messaging requires some changes to the AndroidManifest.xml file, as it needs to set up a ListenerService and a few more things, so it is possible that when it added that logic, it accidentally removed something that you needed. We will keep an eye out for this in the future.