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)

Gaston Claret
  • 1,000
  • 1
  • 7
  • 27

2 Answers2

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

Gaston Claret
  • 1,000
  • 1
  • 7
  • 27
  • 1
    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! – Nicolai Dutka Apr 08 '14 at 23:00
  • @NicolaiDutka, did you have the old `Assets/Examples/InteractiveConsole.cs` lying around? That still might have an old reference to `FB.AppRequest` – Brian Jew Apr 10 '14 at 21:35
  • @Brian, I do and even after deleting that and the InteractiveConsole.unity file, I still get the same error... – Nicolai Dutka Apr 10 '14 at 21:47
  • 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 ); – Nicolai Dutka Apr 10 '14 at 21:52
  • How can I rewrite that to work? Or.. is there a new method I should be using? – Nicolai Dutka Apr 10 '14 at 21:52
  • 1
    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. – Brian Jew Apr 10 '14 at 22:47
  • can you please look into my question here:http://stackoverflow.com/questions/23388069/facebook-fb-init-fail-for-android-unity – silentkratos Apr 30 '14 at 13:19
  • Thankx, @Gaston. You saved my lots of days but couldn't last 4 day. Looking for this solution. Thanks a lot. – MicroEyes Jun 04 '14 at 19:07
  • Can I ask where did you find the new call's signature ? Because when I go to https://developers.facebook.com/docs/unity/reference/current/FB.AppRequest 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) – Geoffrey H Sep 21 '15 at 14:10
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
            );
Ethan
  • 261
  • 2
  • 6