parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
323 stars 260 forks source link

IL2CPP crash during building #324

Closed lvvova1 closed 4 years ago

lvvova1 commented 4 years ago

When i trying build android app, at the stage "building native binary with IL2CPP..." il2cpp.exe crashes

Error message:

IL2CPP error for method 'System.Void Parse.ParseInstallation::b__47_0()' in assembly 'C:\Projects*PROJECT_NAME*\Temp\StagingArea\assets\bin\Data\Managed\Parse.Unity.dll' Additional information: ��뫪� �� ��ꥪ� �� 㪠�뢠�� �� �������� ��ꥪ�.

Building on android: IL2CPP .NET 4.x ARMv7 ARM64

Unity version: 2019.3.0f6

TobiasPott commented 4 years ago

Well, which version of the SDK are you using as a Parse.Unity.dll should not be a product of a build of the latest commit this repository? Did you test it with any previous Unity version and or with a different configuration of the API compatibility (e.g. .NET Standard 2.0 instead of .NET 4.x)?

The situation with unity is somewhat unclear and you might refer to other issues regarding Unity and Unity on Android building problems.

There is no current plan to include Unity support back into the main branch but you may take a look at https://github.com/TobiasPott/Parse-SDK-dotNET/tree/feature/implement-target-platform-configurations for a working solution. Please notice that it is based on the master branch of this repository and does not include every feature which was available in #279 or before (e.g Push Notifications).

onepixelsoft commented 4 years ago

I have the same problem. Any solutions?

TobiasPott commented 4 years ago

@onepixelsoft I'm sorry if this might sound rough but did you actually read my response to the initial post in this thread? If you are using a Parse.Unity.dll then you are not using the latest state of this repository as it no longer contains an explicit build output for Unity. I assume you are using either an older version which most likely noone here can or will provide any solutions for anymore.

You may provide a fair bit of more information about your situation or at least refer to what additional steps (referring to my previous answer) you have tried and what the results of these have been. If you have not done so, see the previous answer of mine for a possible solution or see the latest pull request by TheFanatr if it solves whatever exact issue you are having.

kimcatsq commented 4 years ago

@TobiasPott I'm in the same boat as the others. I write my game code in Unity environment only. When it comes doing things outside Unity (like compiling DLL), I'm a little clueless. So, a bit more instruction/hand-holding on how to use this package would be much appreciated.

It all started with me trying to evaluate the Back4App Parse service with back4app/unity-quickstart-example. I get the error: "error CS0433: The type 'Task' exists in both 'Parse.Unity, Version=1.7.0.0,". I'm using the Unity 2018.4.10f1 (Scripting Runtime Version = .NET 4.x Equivalent, Api Compatibility .NET 4.x).

There are now 3 version of Parse-SDK-dotNET

I'm using Visual Studio Community 2017 (Ver 15.9.1).

Looks like a deep rabbit hole just to setup my environment to do "donet build Parse.sln".

Is there an easier way to get a working Parse Sdk/DLL for Unity? Can I drop the Parse source files directly into my project?

TobiasPott commented 4 years ago

Hi @kimcatsq please excuse my slow response, I'm located in Germany and we had a national holiday which put me away from a PC (at least one from work).

To keep it short, no, as of now there is no easier way to get the assembly for Unity as I didn't found the time to put any updated version into nuget. You'll either need to get it compiled yourself or ask someone to do it for you. If you drop me a contact (dunno if github has a method to directly message someone again) I'll might do so in a free minute during this week.

As of my fork the assembly definitively works with Unity up to 2019.2 as we are using it for a bigger project at work. Thus it should also work with 2018.4.10 you are using. I never checked other parse hosters beside heroku (because I'm lazy) but I assume it does not make any difference whether you use Back4App or Heroku as both, I assume setup Parse from the same sources. Also you selected version of Visual Studio should not make any difference as compiling and referencing the Parse SDK assembly in your Unity project does use Unity built-in tools for the most part.

The current state of the official community package does not work with Unity without modifications and the latest changes of Alex (@TheFanatr ) still hang in review as I need to determine a time slot in office to take a look at those, requested by him. But the community package is the one version to go for when it is merged and a build is available via nuget (or the download section of this repository).

I cannot say anything about the Back4App fork, I didn't know it existed and have no clue at which point it was worked and what differences it may contain (hopefully no service-specific changes).

Back to your problem. To keep you going I can offer you to provide a build version of my fork for now and type a brief guide (with some references to stuff documented in my forked repo). It would help if you can provide my with a contact as mentioned above. I understand that it is a bit more complicated to get everything running, especially within Unity, and I'm sorry that documentation is still lacking at this point (had a hard time too getting into it).

To answer your last question, whether or not you can drop the sources into Unity directly. I would assume you can, including some cleanup of testing sources and other unwanted files (which are related to Visual Studio project management and building) but to be honest I only tried it with a very old version of this repository and had no luck within a moderate time span, I would advise you to not try it, as providing a .dll to you of my fork with a brief description is less work and in the end others might benefit from it too. =)

onepixelsoft commented 4 years ago

Hi @kimcatsq please excuse my slow response, I'm located in Germany and we had a national holiday which put me away from a PC (at least one from work).

To keep it short, no, as of now there is no easier way to get the assembly for Unity as I didn't found the time to put any updated version into nuget. You'll either need to get it compiled yourself or ask someone to do it for you. If you drop me a contact (dunno if github has a method to directly message someone again) I'll might do so in a free minute during this week.

As of my fork the assembly definitively works with Unity up to 2019.2 as we are using it for a bigger project at work. Thus it should also work with 2018.4.10 you are using. I never checked other parse hosters beside heroku (because I'm lazy) but I assume it does not make any difference whether you use Back4App or Heroku as both, I assume setup Parse from the same sources. Also you selected version of Visual Studio should not make any difference as compiling and referencing the Parse SDK assembly in your Unity project does use Unity built-in tools for the most part.

The current state of the official community package does not work with Unity without modifications and the latest changes of Alex (@TheFanatr ) still hang in review as I need to determine a time slot in office to take a look at those, requested by him. But the community package is the one version to go for when it is merged and a build is available via nuget (or the download section of this repository).

I cannot say anything about the Back4App fork, I didn't know it existed and have no clue at which point it was worked and what differences it may contain (hopefully no service-specific changes).

Back to your problem. To keep you going I can offer you to provide a build version of my fork for now and type a brief guide (with some references to stuff documented in my forked repo). It would help if you can provide my with a contact as mentioned above. I understand that it is a bit more complicated to get everything running, especially within Unity, and I'm sorry that documentation is still lacking at this point (had a hard time too getting into it).

To answer your last question, whether or not you can drop the sources into Unity directly. I would assume you can, including some cleanup of testing sources and other unwanted files (which are related to Visual Studio project management and building) but to be honest I only tried it with a very old version of this repository and had no luck within a moderate time span, I would advise you to not try it, as providing a .dll to you of my fork with a brief description is less work and in the end others might benefit from it too. =)

The problem comes with IL2CPP, when you are assembling Parse, with NDKs greater than 13. Unity 2017 gets NDK 13, unity 2018 and 2019 has NDK 16 and 18 I think I remember. I have also tried to catch the latest uploads from the repository and compile and it continues to give the same problem. Anyway, I ruled it out, I went with google firebase. Thank you for your help. Parse needs an activation for IL2CPP for Unity 2018 and 19. Sorry about my English

TobiasPott commented 4 years ago

Well I'm sorry to say that but you are wrong and it does work with IL2CPP (when you consider my statement about my current fork of the community parse repository). We are using it in two application which are developed with Unity for Android and iOS platforms which both run through IL2CPP (iOS by default and Android due to the requirement for arm64 for store distribution).

I'm not aware which NDK Unity 2019 is using but it does work with whatever version Unity ships with as of Unity 2018 and 2019 and with the NDK r16 installed separately when using Unity 2018.

So I doubt that the problem is caused by IL2CPP (in context to Unity 2018 or 2019).

kimcatsq commented 4 years ago

@TobiasPott Hahaha, holiday during this period must be strange. As long as everyone is in good health, all is fine. Like @onepixelsoft, I have started going down the Firebase route. It's a very steep learning curve but it got me going (very slowly). However, I probably still need Parse in the future, I have a strong feeling Firebase won't work in China.

At this stage, I probably won't have time to look into Parse (unless I hit another road block with Firebase). I didn't know you can deploy Parse on Heroku, I thought the only option was on Back4App or your own server. Anyway, thanks for the detail explanation above and will definitely avoid using Parse source file directly in Unity project.

TobiasPott commented 4 years ago

@kimcatsq Yeah it is kinda weird having a free day but be advised to not use it by contacting other people ^^

I was hinted on heroku by a collegue and I think there are some other one-click deployment services which also offer Parse, but I'm not aware of all and never did configure one with storage for larger files on heroku (but it can be done as we use one for our applications).

Glad you can advance with your project using Firebase. I've made me a note to setup GitHub actions to perform automated builds of the assembly so you and others having trouble building it themselves don't need to (I'll first do it on my fork of the repo). Until we have the nuget package updated again.

I will close this issue for now, if you encounter the problem again in the future and I did not manage to setup the automated build, don't hesitate to reopen it and trigger me again.