amazon-archives / aws-sdk-unity

ARCHIVED: The aws sdk for unity is now distributed as a part of aws sdk for dotnet:
https://github.com/aws/aws-sdk-net
Other
105 stars 43 forks source link

Compilation fails on iOS with IL2CPP backend #72

Closed seaders closed 9 years ago

seaders commented 9 years ago

I've submitted a bug report to Unity about this as well, #704022 but I wanted to make you guys aware too. If you try to compile to iOS with an IL2CPP backend, compilation in XCode fails.

Basically it gets the conversion of

UnityHttpErrorResponseExceptionHandler_1_HandleException_..._gshared

wrong, doing something like,

    Object_t * L_56 = V_5;
    Object_t * L_57 = L_56;
    il2cpp_codegen_raise_exception(((Object_t *)L_57));

Down at the end of the block.

It should be working completely differently, or doing something like (based on what's happening in that block),

    il2cpp_codegen_raise_exception((AmazonServiceException_t61 *)L_57);

instead.

You can check it yourself with (your own project with the SDK installed), or our sample project, https://github.com/SixMinute/AWSDatasetSyncOnSuspend

karthiksaligrama commented 9 years ago

Thanks we are taking a look at it. could you also let us know what is the version of unity you are using?

seaders commented 9 years ago

Latest patch version released today, 5.0.3p1.

akinama3 commented 9 years ago

I am facing same probrem on 4.6.6p2.

akinama3 commented 9 years ago

I have realized that something is wrong with the following codes.

var baseServiceException = new T();

I have succeeded IL2CPP build by replacing it as below for the time being on Unity 4.6.6p2:

var baseServiceException = new AmazonServiceException();

Please refer to the codes. https://github.com/aws/aws-sdk-unity/blob/master/Assets/AWSSDK/src/Core/Amazon.Runtime/Pipeline/ErrorHandler/_unity/UnityHttpErrorResponseExceptionHandler.cs#L98

karthiksaligrama commented 9 years ago

@akinama we wouldn't want to change the typed exception to the base exception, because there are different workflow which gets kicked off based on the exception type.

akinama3 commented 9 years ago

@karthiksaligrama Off course, I think so too. Are there some IL2CPP bugs at that line?

androidsauce commented 9 years ago

I am also getting this on Unity 5.1.1f1

seaders commented 9 years ago

Any update on this? @karthiksaligrama no chance you also got in touch with Unity about this? I logged the bug#, 704022 and it'd be great if you guys could jump in with requesting this to be fixed.

karthiksaligrama commented 9 years ago

@seaders i'm unable to find the bug on their issue tracker can you paste the complete url here?

seaders commented 9 years ago

Unfortunately, despite the fact that I checked the "Public" box, it hasn't shown up there, so the only URL I have is to our internal company one, which I can't share publicly, sorry.

Do you guys not have any Unity contacts to be able to contact directly?

karthiksaligrama commented 9 years ago

i just needed it to reference the bug to them. But that's ok. i'll try to reproduce the problem and send them another bug report.

seaders commented 9 years ago

If you're on IRC (#unity3d), main guy who's been a great help to us is Tak there. He's one of their iOS debugging team, not necessarily IL2CPP, but iOS nonetheless and he has escalated some of the issues we've had (with the AWS library, and other things) already.

fyi

karthiksaligrama commented 9 years ago

is it possible for you guys to fall back on 5.0.1p3. I just tested it on that version and seems to be working. In the meantime i'll see if we can circumvent this problem in the sdk as well.

seaders commented 9 years ago

Unfortunately not, no. There was another IL2CPP bug to do with compilation trying to reference Unity Editor code despite it being compiler defined out which meant you couldn't even build the XCode project. That got fixed in the 5.0.3p1 release, along with a few other IL2CPP bugs (but obviously they could well have brought some of this in).

benbritten commented 9 years ago

Hello! Yeah, we have come up hard against this bug as well. We need 5.1.1 for other various reasons, but not being able to build to iOS is killing us at the moment. We are looking at maybe rolling back the AWS SDK to the last version which is also not ideal as we want to be able to use the new stuff. I know this is probably ultimately a problem with Unity's IL2CPP code gen; but if there is something that can be done at the SDK level that would be great.

karthiksaligrama commented 9 years ago

@benbritten at the moment you can follow the fix mentiond by @akinama https://github.com/aws/aws-sdk-unity/issues/72#issuecomment-112296299

benbritten commented 9 years ago

@karthiksaligrama Ok great, thanks for that! We did look at that but were a bit leery as you had mentioned that there may be some downstream issues, but if it is safe enough for now and gets us back on track then I will take it!

5argon commented 9 years ago

Today this bug still exist, but thanks to @akinama that the fix works.

karthiksaligrama commented 9 years ago

temporarily updated the sdk as per @akinama fix until unity fixes this bug on their end