I’m in the process of updating a few apps to be compliant with the Facebook v4 plugin. On iOS, this process was fairly straightforward. However, on Android, it seems to copletely break the app request dialogue. Whenever I run it, the app crashes with:
W/System.err(15690): java.lang.NoSuchMethodError: No virtual method setSuggestions(Ljava/util/List;)Lcom/facebook/share/model/GameRequestContent$Builder; in class Lcom/facebook/share/model/GameRequestContent$Builder; or its super classes (declaration of 'com.facebook.share.model.GameRequestContent$Builder' appears in /data/app/com.X.X-1/base.apk) W/System.err(15690): at plugin.facebook.v4.FacebookController$8.run(FacebookController.java:1217) W/System.err(15690): at android.os.Handler.handleCallback(Handler.java:739) W/System.err(15690): at android.os.Handler.dispatchMessage(Handler.java:95) W/System.err(15690): at android.os.Looper.loop(Looper.java:145) W/System.err(15690): at android.app.ActivityThread.main(ActivityThread.java:5832) W/System.err(15690): at java.lang.reflect.Method.invoke(Native Method) W/System.err(15690): at java.lang.reflect.Method.invoke(Method.java:372) W/System.err(15690): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) W/System.err(15690): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) W/FlurryAgent(15690): Error logged: uncaught E/AndroidRuntime(15690): FATAL EXCEPTION: main
The other dialogues seems to work. Also note that I am using the code from the provided example for testing this:
facebook.showDialog( "requests", { message = "You should download this game!", filter = "APP\_NON\_USERS" })
It seems like the “setSuggestions” function is missing; which is weird in the first place since I’ve tried it both with and without sugestions.
I am using all the latest builds for enterprise and the plugins for the record.
We are tracking through some Facebook bugs now. Can you put together a test app that has this problem and submit a bug report please? It needs to be a complete project that our engineer can run and not have to guess at settings, files etc. Put all of it in a zip file and use the Report a Bug link at the top of this page.
How are you guys hooking in the Facebook SDK, through the source code provided with Corona Enterprise, or the compiled JAR file? If you’re using the distributed source code, you might try using the compiled JAR file of the Facebook SDK instead.
to my build.gradle dependencies, and app starts correctly but there is this error we talk about when launching “requests” dialog.
I also tried to comment that dependency and use facebook_sdk.jar from the enterprise plugin, but then I had another error about R.layout when running the dialog
This method is weird, in the source code it has a concrete java class as a parameter - ArrayList<String>, which is usually a very bad practice. Maybe Facebook devs had a specific reason to put it there, I don’t know, but the preferred way is to have interface like List<String>.
Anyway, somehow in the compiled version of the class GameRequestContent from “facebook_sdk.jar” (Corona enterprise plugins) method is different and uses List<String>! Also in later versions of Facebook SDK, i.e. 4.14, they only ship compiled classes and this one too has a List<String> as a parameter type. I haven’t tried these late SDKs as they enforce a minimumSdk for android to be 15, and we have 10 and don’t want to up this setting.
So I think error comes when reflexion invokes the method, it looks for the one with List<String>, but compiled version from sources has ArrayList<String> parameter and it is technically a different method.
Thank you, setting up Facebook module from this code worked for me!
But isn’t it easier to update facebook.v4 source code with fix for setSuggestions method call, so it would work with 4.5.0 Facebook dependency out of the box?
Any update? Using an experimental version does not seem optimal and I cannot find a plugin.facebook.v4.jar file in it. Unfortunately have no opportunity to build it in my current workflow
I don’t know of any reason why you can’t continue to use the legacy Facebook plugin for now. It targets API 2.1 which is the current minimum and should be that way until next August.
Deprecating doesn’t mean getting rid of now, it usually means getting rid of in the future, here’s your warning. Can you link me to that page? 2.0 has been deprecated for some time and FB got rid of it earlier this month.
They say in the docs, when you click on the value in “Available Until” column:
Version Schedules
Each version is guaranteed to operate for at least two years. A version will no longer be usable two years after the date that the subsequent version is released.
Version 2.2 was introduced 30 October 2014, so 2.1 will be unavailable starting from 30 October 2016.
As I understood it doesn’t mean it would surely break, but all 2.1 calls will be directed to 2.2 handler mechanism starting from that date.
We are tracking through some Facebook bugs now. Can you put together a test app that has this problem and submit a bug report please? It needs to be a complete project that our engineer can run and not have to guess at settings, files etc. Put all of it in a zip file and use the Report a Bug link at the top of this page.
How are you guys hooking in the Facebook SDK, through the source code provided with Corona Enterprise, or the compiled JAR file? If you’re using the distributed source code, you might try using the compiled JAR file of the Facebook SDK instead.
to my build.gradle dependencies, and app starts correctly but there is this error we talk about when launching “requests” dialog.
I also tried to comment that dependency and use facebook_sdk.jar from the enterprise plugin, but then I had another error about R.layout when running the dialog
This method is weird, in the source code it has a concrete java class as a parameter - ArrayList<String>, which is usually a very bad practice. Maybe Facebook devs had a specific reason to put it there, I don’t know, but the preferred way is to have interface like List<String>.
Anyway, somehow in the compiled version of the class GameRequestContent from “facebook_sdk.jar” (Corona enterprise plugins) method is different and uses List<String>! Also in later versions of Facebook SDK, i.e. 4.14, they only ship compiled classes and this one too has a List<String> as a parameter type. I haven’t tried these late SDKs as they enforce a minimumSdk for android to be 15, and we have 10 and don’t want to up this setting.
So I think error comes when reflexion invokes the method, it looks for the one with List<String>, but compiled version from sources has ArrayList<String> parameter and it is technically a different method.