InternalCompilerError when I import the new Facebook 5.1 SDK into my existing project
Asked Answered
A

2

4

If I import this package in a new project, I get no problems at all.

But, when I try to import it into my existing project (that had the 5.0.4 version of the SDK), after the importing finished, I get the followin error message:

Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error

  at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0 

Anyone have any idea why this is happening?

(As extra information, in my project I have Itween & EasyTouch integrated)

Abundant answered 3/4, 2014 at 20:37 Comment(0)
A
6

The problem was that in a Facebook wrapper class that I had for the invites, I had a FB.AppRequest call, which had the signature of the old FacebookSDK. This was causing the internal compiler error.

Hope it helps you guys, and dont lose a day like I did

Abundant answered 4/4, 2014 at 13:2 Comment(9)
I have the same problem but have been COMPLETELY unable to locate ANYTHING wrong... I am not using any "FB.AppRequest" calls ANYWHERE... I have a "FB.API" call... I have no idea how to tell if there is an old FacebookSDK signature or what that even is... I assumed I just import the new package and start using it... This is a NIGHTMARE!Lukewarm
@NicolaiDutka, did you have the old Assets/Examples/InteractiveConsole.cs lying around? That still might have an old reference to FB.AppRequestUnknown
@Brian, I do and even after deleting that and the InteractiveConsole.unity file, I still get the same error...Lukewarm
private void CallAppRequestAsFriendSelector() { int? maxRecipients = null; if (FriendSelectorMax != "") { try { maxRecipients = Int32.Parse(FriendSelectorMax); } catch (Exception e) { Debug.Log(e.Message); } } string[] excludeIds = (FriendSelectorExcludeIds == "") ? null : FriendSelectorExcludeIds.Split(','); FB.AppRequest( message: FriendSelectorMessage, filters: FriendSelectorFilters, excludeIds: excludeIds, maxRecipients: maxRecipients, data: FriendSelectorData, title: FriendSelectorTitle, callback: appRequestCallback );Lukewarm
How can I rewrite that to work? Or.. is there a new method I should be using?Lukewarm
The new one calls it like this FB.AppRequest( FriendSelectorMessage, null, FriendSelectorFilters, excludeIds, maxRecipients, FriendSelectorData, FriendSelectorTitle, Callback ); Unity had a problem with overloaded methods and calling them with parameter names. So leave those out.Unknown
can you please look into my question here:#23388569Obolus
Thankx, @Gaston. You saved my lots of days but couldn't last 4 day. Looking for this solution. Thanks a lot.Cly
Can I ask where did you find the new call's signature ? Because when I go to developers.facebook.com/docs/unity/reference/current/… which I believe is the last version of the documentation, it still refers to the old call. (or at least trying to call AppRequest in the way they explain gives me the same error)Brooklime
E
4

Unity doesn't support named parameters. So always use FB.AppRequest() function like this:

        FB.AppRequest("WHAT'S UP?" //message
            , null //to
            , "" //filters
            , null //excludeIds
            , null //maxRecipients
            , "" //data
            , "ASKING YOU" //title
            , myCallback //callback
            );
Eisen answered 24/4, 2014 at 0:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.