Backendless SDK for Unity 2020.3 and up

Hey,

I have been working with the .NET SDK within Unity3D for some time now, which seems to be working just fine within the editor. However, it seems that the last version of the Unity package (from .NET-SDK/Projects/BackendlessUnitySDK/UnityPackage at master · Backendless/.NET-SDK · GitHub) does not seem to work with the latest LTS version of Unity (2020.3.25f1) or any version after that.

The latest version I got working is 2019.4.34f1

I know the github page mentions the latest version has been tested against 2018.2.1f1 so I am wondering if support is coming for later versions?

The issue can easily be reproduced by creating a clean project and simply import the latest unitypackage from the link above. You might need to remove some packages from the Unity Package Manager due to conflicts with a NewtownSoft JSON dll.

Settings I am using (that might be relevant):

  • Build Target: Android
  • Scripting Backend: IL2CPP
  • Api Compatibility level: .NET 4.x

The error I am getting after being stuck in the Build Prompt for 5 minutes:

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building player because script class layout might be incompatible between the editor and the player.
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <7ac35247888b44f4a7e290f1f6bb33f3>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <7ac35247888b44f4a7e290f1f6bb33f3>:0 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Additionally (not sure if this is a Unity thing or could be fix by Backendless) I am getting the following errors/issues in 2021.2.x versions of Unity3D:

Loading assembly failed: "Assets/BackendlessSDK/System.Runtime.InteropServices.RuntimeInformation.dll" reason: File does not contain a valid CIL image
Loading assembly failed: "Assets/BackendlessSDK/System.IO.Compression.dll" reason: File does not contain a valid CIL image
Loading assembly failed: "Assets/BackendlessSDK/System.Threading.Overlapped.dll" reason: File does not contain a valid CIL image
Loading assembly failed: "Assets/BackendlessSDK/System.Globalization.Extensions.dll" reason: File does not contain a valid CIL image

Hope this gives some information in case of updating the SDK. I can make do with downgrading, but would love to keep working on the latest version of Unity as well as Backendless.

Hello @Joey_Fladderak,

Thank you for reporting this issue and clear steps to reproduce it!
I have created an internal ticket (BKNDLSS-27395) in order to investigate it.
We will keep you updated here on any progress.

Regards,
Stanislaw

Hello,

We are having the same issue with Unity 2020.3.30f1 on Android. Is there an ETA on a solution for this problem? It’s critical for our project to use Unity 2020.3.x

Thank you.

Hello @David_Warhol

Welcome to our community and thank you for trying out Backendless.

I will discuss the priority of the task and will let you know some estimates.

@David_Warhol

sorry, but we will be able to start work on the task in a month approximately

Hello, @David_Warhol and @Joey_Fladderak.

We have added a new version of the BackendlessUnitySDK. Now everything should work as it expected. Let us know if your issue has been resolved.

Best Regards, Nikita.

Thank you for the expedited feature and for the notice. We’ll add it to our task list this week and will let you know if we experience any difficulties.

Best,

David Warhol

1 Like

Just updated to Unity 2021.3.0f1 with the latest Backendless SDK and it seems to be working as expected!

We’re still in the process of fully integrating all functionality we require from Backendless, but at least I was able to compile the app and log in from the app on a tablet.

2 Likes

I just installed BackendlessSDK-UnityPackage-6.2.2.0.unitypackage in 2020.3.26f1 and I have the same error still when I try to build for Android.

Hello, @Christopher_Ellis.

Please post the text of the error.
We are investigating this issue.

Best Regards, Nikita.

Thanks for the fast response. The full error message is just “Error building player because script class layout might be incompatible between the editor and the player.”

This is followed by: “Build completed with a result of ‘Failed’ in 324 seconds (323947 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)”

And finally: “UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <55729f52d042492e9efc384182ae2feb>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <55729f52d042492e9efc384182ae2feb>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)”

Could you elaborate on 2 more points:
Does the error occur on older versions of the unit?
Does the problem only occur with Backendless?

This problem only occurs when adding the Backendless SDK. Removing the SDK removes the error and lets me build properly.

That is generally an error that happens in Unity when you have a serialized member(s) in between some preprocessor directive(s)

Something like

#if UNITY_EDITOR
[SerializeField] private int someVariable
#endif

Unity doesn’t like that.

I would look for that, but it’s all in DLLs.

Hello, @Christopher_Ellis, @Joey_Fladderak.

We have added a new version of unitypackage 6.2.3.0, could you clarify if everything is now working as expected?

Best Regards, Nikita,

One more clarification. Does the problem only occur when building for Android?

This problem is still happening on Android. I also tried a clean project with just the new version of Backendless on iOS in 2021.3.0f1 (the new LTS version) and the same problem happened.

I’m fairly confident @Joey_Fladderak is correct that this problem is happening because you have a serialized field inside a preprocessor directive.

Ok, thank you. We will investigate this issue.

It’s odd that it is working on our project though.

Though I have to add that we have removed the TestDataService scripts and the BackendlessPlugin.cs file to make it compatible with our codebase (though we did move over the logic from the plugin script).

Nothing obvious in the removed scripts though that would indicate this behaviour.