[Unity] Issue for Firebase 4.0.3 with Unity 2017.1 for .NET 4.6

15,474 views
Skip to first unread message

Hieu Tran ngoc

unread,
Aug 16, 2017, 10:27:42 AM8/16/17
to Firebase Google Group
Hi,

Appreciate everyone help, I'm currently having issue with System.Threading.Tasks in Unity when install Firebase sdk.

Below code is working fine in Unity 2017 with .NET 4.6:

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class GameController : MonoBehaviour {
  void Start () {
    Task anyTask = new Task(action: () => Debug.Log("Task run"));
    anyTask.Start();
  }
}

However, when I install the Firebase sdk 4.0.3, the following error appear:
The type 'Task' exists in both 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' [Assembly-CSharp]
System.Threading.Tasks.Task

Assets/BuildXcape/GameController.cs(8,3): error CS0433: The imported type `System.Threading.Tasks.Task' is defined multiple times

In the release note for sdk 4.0.3, it already mentioned that support for System.Tasks in .NET 4.6 has been added. Is there anything else that I have missed?

Stewart Miles

unread,
Aug 16, 2017, 11:16:12 AM8/16/17
to Firebase Google Group
Unfortunately, it's not possible to target specific DLLs to a .NET version in Unity.  So what we have done is added support to import the Firebase SDK into a .NET 3.5 project and then when you switch to 4.6 all of the .NET 3.5 DLLs are disabled and .NET 4.5 DLLs are enabled.

Since you're already using .NET 4.5 in your project you need to do the following:
  • Disable / remove Parse/Unity.Tasks.dll
  • Enable / reimport Parse/dotNet45/Unity.Tasks.dll

Cheers,
stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/14bf1d61-90fb-44a6-a61b-7181fcabd3cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Flavio Engel

unread,
Aug 20, 2017, 12:08:12 PM8/20/17
to Firebase Google Group
After removing the Unity.Tasks.dll from the plugins folder in Unity, the project compiles, but start giving other errors.

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

Stewart Miles

unread,
Aug 21, 2017, 1:27:54 PM8/21/17
to Firebase Google Group
You still need the Parse/dotNet45/Unity.Tasks.dll to compile the project.  By default the DLL is disabled, you'll need to enable it for the target platform.

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

tomer...@nogame.ltd

unread,
Dec 6, 2017, 9:54:55 AM12/6/17
to Firebase Google Group
Hi,

I'm also encountering this issue.
I tried the above steps but with no success.

If I remove all the Unit.Tasks.dll + Unity.Compat.dll then the project is indeed compiled, but in runtime, I'm getting the following exception (And after unloading of Firebase dll):

FileNotFoundException: Could not load file or assembly 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:67)
System.Reflection.MonoMethod.GetPseudoCustomAttributes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:405)
System.MonoCustomAttrs.GetPseudoCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:77)
System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:320)
System.Reflection.MonoMethod.IsDefined (System.Type attributeType, System.Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:386)
System.Attribute.IsDefined (System.Reflection.MemberInfo element, System.Type attributeType, System.Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/attribute.cs:627)
System.Attribute.IsDefined (System.Reflection.MemberInfo element, System.Type attributeType) (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/attribute.cs:602)
UnityEditor.EditorAssemblies.ProcessStaticMethodAttributes (System.Type type) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:101)
UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes () (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:164)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()


Unloading broken assembly Assets/Firebase/Plugins/Firebase.Platform.dll, this assembly can cause crashes in the runtime
Unloading broken assembly Assets/Firebase/Plugins/Firebase.App.dll, this assembly can cause crashes in the runtime


I also tried to leave Parse/dotNet45/Unity.Tasks.dll and enable it but it didn't work as well (on runtime I got the above exception).


Seems like it is related to this issue:

As well as this:

Anything that can be done?
I cannot go back to .Net 2 Unity support, because all my codebase is using C#6.

Stewart Miles

unread,
Dec 6, 2017, 10:54:11 AM12/6/17
to Firebase Google Group
Hi,

You need Unity.Tasks.dll in the project, we use it in the SDK.  That's why you're seeing an assembly not found message, Firebase references Unity.Tasks.dll etc.  We have support for switching the metadata to configure each tasks DLL (if your project has no errors) when importing into a .NET 3.x project then switching to .NET 4.x.  If you can't do that you can configure the Parse DLLs manually, see here https://groups.google.com/d/msg/firebase-talk/OMtbNrb9FEI/u7MEmsn2BgAJ

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

tomer...@nogame.ltd

unread,
Dec 6, 2017, 7:26:36 PM12/6/17
to Firebase Google Group
Hi,

Tried exactly what you said on that thread, but I'm still getting compilation errors.

The type 'Tuple<T1, T2>' exists in both 'Unity.Compat, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

The type 'IProgress<T>' exists in both 'Unity.Compat, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


Stewart Miles

unread,
Dec 6, 2017, 7:32:36 PM12/6/17
to Firebase Google Group
You need to configure Unity.Compat.dll in the same way as Unity.Tasks.dll.

i.e For .NET 3.x use:
Parse/Unity.Tasks.dll
Parse/Unity.Compat.dll

For .NET 4.x use:
Parse/dotNet45/Unity.Tasks.dll
Parse/dotNet45/Unity.Compat.dll


To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

tomer...@nogame.ltd

unread,
Dec 10, 2017, 6:09:02 PM12/10/17
to Firebase Google Group
Hi,

I did that and it indeed works on the editor when the platform is set to PC.
However, when I switch to Android platform and try to run or build it fails with the following exceptions:

ArgumentException: The Assembly Unity.Compat is referenced by Firebase.Platform ('Assets/Firebase/Plugins/Firebase.Platform.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:142)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:148)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:179)
UnityEditor.HostView:OnGUI()

And also:

NullReferenceException: Object reference not set to an instance of an object
GooglePlayServices.AndroidSdkManager+<Create>c__AnonStorey0.<>m__0 (GooglePlayServices.AndroidSdkPackageCollection packages) (at <d0153a8eebcc4b93a77ccb561d531496>:0)
GooglePlayServices.SdkManager+<QueryPackages>c__AnonStorey0.<>m__0 (GooglePlayServices.CommandLine+Result result) (at <d0153a8eebcc4b93a77ccb561d531496>:0)
GooglePlayServices.SdkManagerUtil+<QueryPackages>c__AnonStorey0.<>m__0 (GooglePlayServices.CommandLine+Result result) (at <d0153a8eebcc4b93a77ccb561d531496>:0)
GooglePlayServices.CommandLineDialog+ProgressReporter.Update (GooglePlayServices.CommandLineDialog window) (at <d0153a8eebcc4b93a77ccb561d531496>:0)
GooglePlayServices.CommandLineDialog.Update () (at <d0153a8eebcc4b93a77ccb561d531496>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:305)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:313)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:341)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:109)

tomer...@nogame.ltd

unread,
Dec 10, 2017, 6:09:02 PM12/10/17
to Firebase Google Group


On Thursday, December 7, 2017 at 2:32:36 AM UTC+2, Stewart Miles wrote:

bry...@moback.com

unread,
Dec 13, 2017, 5:29:39 PM12/13/17
to Firebase Google Group
I'd like to bump this as I'm having the same issue. There does not seem to be a dotNet45/Unity.Compat.dll file.

What would you advise?

- Bryan

bry...@moback.com

unread,
Dec 16, 2017, 8:21:10 PM12/16/17
to Firebase Google Group
In lieu of a response, I was able to workaround the lack of a .NET 4.6 Unity.Compat.dll by -

1) Replacing all uses of Tuple`2 with KeyValuePair in my code.
2) Getting rid of all uses of Func`5 by putting its multiple parameter values into a single struct.
3) Going forward, generally avoiding use of the smattering of standard .NET types / extension methods that Unity.Compat defines.
4) Pray to the software Gods that this workaround works on the device targets as well (it should, but who knows?)

If a Unity.Compat.dll cannot be provided, can y'all at least tell us how you created the Unity.Tasks so we can create a comparable Unity.Compat.dll its own type forwarders? If you can let me know what techniques you used, I'm willing to build this .dll manually and provide it to the community.

Thanks in advance for following up!

- Bryan

Stewart Miles

unread,
Dec 18, 2017, 7:13:39 PM12/18/17
to Firebase Google Group
Sorry about the slow response on this.  We still haven't had a chance to take a look into this issue.

The Unity.Tasks.dll type forwarding DLL is open here:

The plugin that builds the Unity plugin is here:

It definitely sounds like Unity changed something recently that broke Unity.Compat.dll in .NET 4.x.  Any chance you have a minimal reproducible case?  e.g can you reproduce a build failure by patching one of our samples https://github.com/firebase/quickstart-unity ?

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

bry...@moback.com

unread,
Dec 19, 2017, 2:23:02 PM12/19/17
to Firebase Google Group
As for a repro, you just have to use Tuple`2 or IProgress anywhere, and the compiler will issue a duplicate type definition error.

bry...@moback.com

unread,
Dec 19, 2017, 2:23:02 PM12/19/17
to Firebase Google Group
Thanks for the follow up!

I've created a pull request that fixes the issue here - https://github.com/parse-community/Parse-SDK-dotNET/pull/281

Hopefully they'll pull it in, and if not, it should be a good enough solution for others here.

Cheers!


On Monday, December 18, 2017 at 4:13:39 PM UTC-8, Stewart Miles wrote:

Stewart Miles

unread,
Jan 9, 2018, 1:50:28 PM1/9/18
to Firebase Google Group
Nice patch bryane@, we'll try merging this into our internal copy of the Parse Tasks component ;)

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Anurag Shrinagar

unread,
Jan 18, 2018, 10:54:12 AM1/18/18
to Firebase Google Group
I don't know how to create dll files from source code.. So I can use briyan's solution. Is there any ready solution? I need it badly since I can't proceed without System.Threading.Tasks.Task and it is showing conflict with Unity.Tasks. Any help? I am on fibrebase 4.4.0 sdk and .Net 4.6

Stewart Miles

unread,
Jan 18, 2018, 10:58:03 AM1/18/18
to Firebase Google Group
We're integrating the patch at the moment into the SDK which should land in a release within the next couple of weeks.

In the meantime you can:
Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

John Butterfield

unread,
Jan 31, 2018, 2:04:21 PM1/31/18
to Firebase Google Group
Message has been deleted

tomer...@no.game

unread,
Feb 6, 2018, 10:11:33 AM2/6/18
to Firebase Google Group
I just upgraded the new SDK and adjusted the dlls (Unity.Compat and Unity.Tasks) as described above (only included the 4.5 dlls) and the project indeed compiles.

However when trying to build an apk I'm getting the following failure:






Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --development-mode --dotnetprofile="net45" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\dev\*****\git\unity\*****\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files (x86)/Android/android-ndk-r13b" --map-file-parser="C:\Program Files\Unity\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.UI.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\UnityMultiSelectDropdown.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\TextMeshPro-2017.1-1.0.56-Runtime.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\DOTween.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Analytics.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\Firebase.App.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\Mono.Security.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\mscorlib.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\Stores.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\System.Core.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\System.dll" --assembly="C:\dev\*****\git\unity\*****\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Purchasing.dll" --generatedcppdir="C:\dev\*****\git\unity\*****\Temp\StagingArea\Il2Cpp\il2cppOutput" 


stdout:
IL2CPP error (no further information about what managed code was being converted is available)
Additional information: Build a development build for more information. Specified argument was out of the range of valid values.
il2cpp.exe didn't catch exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
   at Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
   at Mono.Cecil.MetadataReader.ReadExportedTypes()
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   at Mono.Cecil.ModuleDefinition.get_ExportedTypes()
   at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.GetType(ModuleDefinition module, TypeReference reference)
   at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
   at Mono.Cecil.TypeReference.Resolve()
   at Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Process(Instruction instruction, MethodDefinition method)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.ProcessType(TypeDefinition type)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Collect(AssemblyDefinition assembly)
   at Unity.IL2CPP.AssemblyConverter.Apply()
   at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName)
   at il2cpp.Program.DoRun(String[] args)
   at il2cpp.Program.Run(String[] args)
   at il2cpp.Program.Main(String[] args)
stderr:


Unhandled Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
   at Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
   at Mono.Cecil.MetadataReader.ReadExportedTypes()
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   at Mono.Cecil.ModuleDefinition.get_ExportedTypes()
   at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.GetType(ModuleDefinition module, TypeReference reference)
   at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
   at Mono.Cecil.TypeReference.Resolve()
   at Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Process(Instruction instruction, MethodDefinition method)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.ProcessType(TypeDefinition type)
   at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Collect(AssemblyDefinition assembly)
   at Unity.IL2CPP.AssemblyConverter.Apply()
   at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName)
   at il2cpp.Program.DoRun(String[] args)
   at il2cpp.Program.Run(String[] args)
   at il2cpp.Program.Main(String[] args)

Something that I'm missing?

Stewart Miles

unread,
Feb 6, 2018, 12:58:20 PM2/6/18
to Firebase Google Group
Well this is a bummer.

.NET 4.x using the Unity.Compat.dll & Unity.Tasks.dll result in a functional build when not using IL2CPP.
Enable IL2CPP and it throws ArgumentOutOfRangeException when trying to compile.

Switch to using the .NET 3.x Unity.Compat.dll instead of the .NET 4.x forwarding DLL and the IL2CPP build completes successfully but then we end up in a state where it's not possible to use Tuple again :/

I then tried building the Unity.Compat.dll forwarding DLL from https://github.com/stewartmiles/Parse-SDK-dotNET on my Mac (different mono distro to our build machines) and importing it into a project, turns out *that* works.

So alas, the workaround at the moment is:
We'll take a look into the differences between our release build environment vs. a working environment.

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

tomer...@no.game

unread,
Feb 7, 2018, 10:59:43 AM2/7/18
to Firebase Google Group
Hi,

The workaround seems to work well!

Thanks!
Message has been deleted

Stewart Miles

unread,
Feb 28, 2018, 12:49:27 PM2/28/18
to Firebase Google Group

On Tue, Feb 27, 2018 at 8:30 PM, <con...@seanzeng.com> wrote:
Does firebase 4.4.3 have this update? IL2CPP for IOS building has a similar "argument out of range exception" after upgrading to 4.4.2.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
Message has been deleted

5ar...@exceed7.com

unread,
Mar 31, 2018, 10:59:13 AM3/31/18
to Firebase Google Group
I have confirmed that this is still the problem using a fresh project of Unity 2017.3.1f1 and Unity 2017.4.0f1. Just create a new project, add Auth, DB, Storage, InstanceID and your config file. This point the build to iOS pass (.NET3.5 + IL2CPP) but switching to .NET 4.6 fails the build. (Still IL2CPP)

Jimmy Alger

unread,
Apr 2, 2018, 9:26:58 PM4/2/18
to Firebase Google Group
You need to check the DLLs in the Parse folder.  Enable the two dotNet45 dlls and disable the other two.  Look for the section of this page that says "Known Issues - Installing Plugins in Unity 2017.x .NET 4.x Projects" 

rs360...@gmail.com

unread,
Apr 12, 2018, 6:46:16 PM4/12/18
to Firebase Google Group
I checked the dlls and still getting the OutOfRange exception on iOS. On Windows build for Android works.
Any other hints?

Thanks 

Leonardo Bilck

unread,
Apr 13, 2018, 8:32:37 PM4/13/18
to Firebase Google Group
Hello,

We are having the following when trying to build for Android using .NET 4.X runtimes on Unity 2017.3 and 2018.0:

Failed running C:\Program Files\Unity 2018\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --development-mode --dotnetprofile="unityjit" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity 2018\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity 2018\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="D:/Android/android-ndk-r13b" --map-file-parser="C:\Program Files\Unity 2018\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Assembly-UnityScript.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.UI.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\DOTween.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Analytics.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\AWSSDK.CognitoIdentity.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\AWSSDK.Core.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\AWSSDK.S3.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\AWSSDK.SecurityToken.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Firebase.App.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Mono.Security.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\mscorlib.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Stores.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\System.Core.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\System.dll" --assembly="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Purchasing.dll" --generatedcppdir="C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\Il2Cpp\il2cppOutput" 

stdout:
IL2CPP error for method 'System.Boolean Firebase.Unity.UnitySynchronizationContext/SynchronizationContextBehavoir/<Start>c__Iterator0::MoveNext()' in assembly 'C:\PlotKids\Projetos\MSP\ToyTV\monica-tv-hg\src\unity\Temp\StagingArea\assets\bin\Data\Managed\Firebase.Platform.dll'
Additional information: Build a development build for more information. Argumento especificado estava fora do intervalo de valores v�lidos.
il2cpp.exe didn't catch exception: System.ArgumentOutOfRangeException: Argumento especificado estava fora do intervalo de valores v�lidos.
   em Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
   em Mono.Cecil.MetadataReader.ReadExportedTypes()
   em Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   em Mono.Cecil.ModuleDefinition.get_ExportedTypes()
   em Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.GetType(ModuleDefinition module, TypeReference reference)
   em Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
   em Mono.Cecil.TypeReference.Resolve()
   em Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Process(Instruction instruction, MethodDefinition method)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.ProcessType(TypeDefinition type)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Collect(AssemblyDefinition assembly)
   em Unity.IL2CPP.AssemblyConverter.Apply()
   em Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
   em il2cpp.Program.DoRun(String[] args)
   em il2cpp.Program.Run(String[] args)
   em il2cpp.Program.Main(String[] args)
stderr:

Exce��o Sem Tratamento: System.ArgumentOutOfRangeException: Argumento especificado estava fora do intervalo de valores v�lidos.
   em Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
   em Mono.Cecil.MetadataReader.ReadExportedTypes()
   em Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   em Mono.Cecil.ModuleDefinition.get_ExportedTypes()
   em Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.GetType(ModuleDefinition module, TypeReference reference)
   em Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.Resolve(TypeReference type)
   em Mono.Cecil.TypeReference.Resolve()
   em Unity.IL2CPP.Extensions.IsInterface(TypeReference type)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Process(Instruction instruction, MethodDefinition method)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.ProcessType(TypeDefinition type)
   em Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Collect(AssemblyDefinition assembly)
   em Unity.IL2CPP.AssemblyConverter.Apply()
   em Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
   em il2cpp.Program.DoRun(String[] args)
   em il2cpp.Program.Run(String[] args)
   em il2cpp.Program.Main(String[] args)

UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
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:362)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String, Boolean) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:343)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:162)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:35)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp:Execute(PostProcessorContext)
UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks(PostProcessorContext)
UnityEditor.Android.PostProcessAndroidPlayer:PostProcess(BuildTarget, String, String, String, String, String, String, BuildOptions, RuntimeClassRegistry, BuildReport)
UnityEditor.Android.AndroidBuildPostprocessor:PostProcess(BuildPostProcessArgs, BuildProperties&)
UnityEditor.PostprocessBuildPlayer:Postprocess(BuildTargetGroup, BuildTarget, String, String, String, Int32, Int32, BuildOptions, RuntimeClassRegistry, BuildReport) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\PostprocessBuildPlayer.cs:285)
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:333)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:230)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:212)
PlotBuildTools:Build(String, BuildTarget, BuildOptions) (at Assets\_PlotKids\Editor\PlotBuildTools.cs:164)
PlotBuildTools:BuildAndroid() (at Assets\_PlotKids\Editor\PlotBuildTools.cs:94)
 
(Filename: Assets/_PlotKids/Editor/PlotBuildTools.cs Line: 164)

Exception: C:\Program Files\Unity 2018\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
  at UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) [0x0011a] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildUtils.cs:130 
  at UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) [0x00063] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildUtils.cs:73 
  at UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) [0x0008b] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:362 
  at UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.Collections.Generic.ICollection`1[T] userAssemblies, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) [0x002e5] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:343 
  at UnityEditorInternal.IL2CPPBuilder.Run () [0x00099] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:162 
  at UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) [0x0001e] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:35 
  at UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x001a1] in <6b4589a23abe4ded8d861e24c7b74eb9>:0 
  at UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00074] in <6b4589a23abe4ded8d861e24c7b74eb9>:0 
  at 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) [0x00273] in <6b4589a23abe4ded8d861e24c7b74eb9>:0 
  at UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) [0x00001] in <6b4589a23abe4ded8d861e24c7b74eb9>:0 
  at 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) [0x000d9] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\PostprocessBuildPlayer.cs:285 
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:333)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:230)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\BuildPipelineBindings.gen.cs:212)
PlotBuildTools:Build(String, BuildTarget, BuildOptions) (at Assets\_PlotKids\Editor\PlotBuildTools.cs:164)
PlotBuildTools:BuildAndroid() (at Assets\_PlotKids\Editor\PlotBuildTools.cs:94)
 
(Filename: <6b4589a23abe4ded8d861e24c7b74eb9> Line: 0)


rs360...@gmail.com

unread,
Apr 13, 2018, 8:32:37 PM4/13/18
to Firebase Google Group
I managed to make it work for iOS using Unity.Compat 3.5 and Unity.Task is still from dotNet45.

Hoàng Chung

unread,
Apr 14, 2018, 1:20:17 PM4/14/18
to Firebase Google Group
Yep. But this is have error when using with Unity ECS

Vào 07:32:37 UTC+7 Thứ Bảy, ngày 14 tháng 4 năm 2018, rs360...@gmail.com đã viết:

Leonardo Bilck

unread,
Apr 17, 2018, 6:11:08 PM4/17/18
to Firebase Google Group
Is there an estimate from the Firebase team on when this issue is gonna be fixed?

Soon Unity 2018 we'll be released, which uses .NET 4.X as the default runtime version.

intell...@tyri.se

unread,
Apr 18, 2018, 8:44:25 PM4/18/18
to Firebase Google Group
I got rid of the conflicts between the different "Task" when I followed the instructions under "Known Issues" (building for Android using Unity 2017.3.1f1 (64-bit))
but only after I also followed:
"Select the menu item Assets > Play Services Resolver > Version Handler > Update to re-enable .NET 4.x DLLs and disable .NET 3.x DLLs."
which is only stated as "If you import another Firebase plugin:".

Stewart Miles

unread,
Apr 20, 2018, 3:41:49 PM4/20/18
to Firebase Google Group
Hi everyone,

It seems each release of Unity with a new revision of IL2CPP is causing problems for our type forwarding DLLs used to provide a compatible interface with .NET 4.x.

I've pushed the type forwarding DLLs built with the "MonoBleedingEdge" distribution of Unity 2017.3.1f1 to https://github.com/stewartmiles/Parse-SDK-dotNET/tree/binaries .  I was able to get Firebase to build using .NET 4.x and IL2CPP for Android by replacing the DLLs under Assets/Parse/Plugins/dotNet45/ with the binaries in https://github.com/stewartmiles/Parse-SDK-dotNET/raw/binaries/Unity.TypeForwards.zip .

Please give it a try and let us know how this works out.  It seems each machine and each point release of Unity is a special flower.

Cheers,
Stewart


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

Praveen Chukka

unread,
Jul 18, 2018, 10:22:15 AM7/18/18
to Firebase Google Group
I don't understand what this Parse thing is all about, but I solved the issue. I just Changed back to .net version .net 3.5 subset in unity. Then changed it back to .net 4.0 and it worked.

Jason Burbage

unread,
Aug 3, 2018, 9:46:23 AM8/3/18
to Firebase Google Group
Praveen's workaround worked for me too. I had already deleted the .net 3.5 version DLLs when I tried it. Don't know if that matters.

Duc Hanh Nguyen

unread,
Sep 8, 2018, 10:53:19 AM9/8/18
to Firebase Google Group
Praveen's tip make my project works too. 

Yaniv Shaked

unread,
Oct 3, 2018, 10:21:02 AM10/3/18
to Firebase Google Group
Same here, Praveen's tip worked for me too. Thanks!

Nahuel Arjona

unread,
Oct 20, 2018, 12:44:50 AM10/20/18
to Firebase Google Group
Workaround worked for me! Unity 2018.1.4f1

Stewart Miles

unread,
Oct 22, 2018, 9:09:00 PM10/22/18
to fireba...@googlegroups.com
FYI: In the 5.4.0 SDK (released last week) we now ship plugins configured for .NET 3.x and .NET 4.x projects separately so you just need to import the appropriate plugin based upon your project's configuration.  If you switch .NET version the plugin - assuming you have no errors in your project - the Firebase editor plugin will reconfigure the Firebase SDK to correctly target the selected .NET version.

Reply all
Reply to author
Forward
0 new messages