0

We're having this issue on both our applications - one written in Sencha Touch2 and another without such sh0t. On both applications we experience same error using forge.facebook: First auth, then on success re-open app and logout from facebook - this results an app crash with popup: "Unfortunately, AppName has stopped."

Here is the logcat log on login then logout without re-open app:

D/Forge   (10379): Returned: {"content":true,"callid":"1B5B7367-8CE2-4F45-AE6A-CBE660026F79","status":"success"}
D/Forge   (10379): Native call facebook.logout with task.params: {}
D/Facebook-Util(10379): GET URL: https://api.facebook.com/restserver.php?access_token=CAAGM3jqOnesBAIc4G2SHQxgXiIpgWbWIMZAHpw5V2G5BW8nUwjPhosSCBp7EN1Ktw0i4JkVVIrs4Alza3cTzEG1ukFHLuC3MSRBYXViywvoBGlYF2CJh26ecL4ZCwfmEbdMTWwqrvK2lAJ7rLRm4TipkEknTcZD&method=auth.expireSession&format=json
W/InputMethodManagerService( 2176): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@418be858 attribute=null, token = android.os.BinderProxy@4134a3a8
D/dalvikvm(10379): GC_CONCURRENT freed 529K, 46% free 4145K/7588K, paused 5ms+3ms, total 55ms
D/Forge   (10379): Returned: {"content":null,"callid":"CF3C2DED-3CB5-4611-8348-BC355B24D4FB","status":"success"}

andlog on login then logout with re-open app:

D/Forge   (10634): Returned: {"content":true,"callid":"4A65AEED-B87B-48A3-8DB2-1438E9D4A321","status":"success"}
D/Forge   (10634): Native call facebook.logout with task.params: {}
D/Facebook-Util(10634): GET URL: https://api.facebook.com/restserver.php?access_token=CAAGM3jqOnesBABZB5d11jcrodjJxHbQfsVaO2eeRscElZCEW2NBjSN176YQqxfTKUZAtAd1FxlikpMEw0SrKorJ89TtQWj0zuXBH1m15ydvQo42sFOEormrKobfzXXTmHuR1Ip4dV8zjlWSZCPRP&method=auth.expireSession&format=json
W/InputMethodManagerService( 2176): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@412dbd50 attribute=null, token = android.os.BinderProxy@41491850
W/dalvikvm(10634): threadid=32: thread exiting with uncaught exception (group=0x40dd7930)
E/AndroidRuntime(10634): FATAL EXCEPTION: Thread-487
E/AndroidRuntime(10634): java.lang.IllegalArgumentException: Invalid context argument
E/AndroidRuntime(10634):    at android.webkit.CookieSyncManager.createInstance(CookieSyncManager.java:86)
E/AndroidRuntime(10634):    at com.facebook.internal.Utility.clearCookiesForDomain(Utility.java:261)
E/AndroidRuntime(10634):    at com.facebook.internal.Utility.clearFacebookCookies(Utility.java:285)
E/AndroidRuntime(10634):    at com.facebook.Session.closeAndClearTokenInformation(Session.java:593)
E/AndroidRuntime(10634):    at com.facebook.android.Facebook.logoutImpl(Facebook.java:667)
E/AndroidRuntime(10634):    at com.facebook.android.AsyncFacebookRunner$1.run(AsyncFacebookRunner.java:89)
W/ActivityManager( 2176):   Force finishing activity com.bigmage.facerage/io.trigger.forge.android.core.ForgeActivity
D/AKMD2   ( 2176): akm_disable_sensor: Accel is disabled. (orien = 0)
I/AKMD2   ( 2176): enable_accelerometer, mEnabled = 1, enable = 0
D/dalvikvm(10634): GC_CONCURRENT freed 3635K, 52% free 3671K/7588K, paused 13ms+4ms, total 189ms
D/dalvikvm( 2176): GC_FOR_ALLOC freed 649K, 34% free 11995K/18024K, paused 114ms, total 116ms
I/dalvikvm-heap( 2176): Grow heap (frag case) to 12.996MB for 635812-byte allocation
I/ActivityManager( 2176): Displayed com.cyanogenmod.trebuchet/.Launcher: +666ms
D/android.widget.GridLayout( 2479): vertical constraints: y2-y0>=120, y3-y2>=78, y3-y0<=192, y2-y1<=1 are inconsistent; permanently removing: y3-y0<=192. 
D/Forge   (10634): Native call request.ajax with task.params: {"url":"http://192.168.1.109/facerage.dev/backend/data/getStatus?token=CAAGM3jqOnesBABZB5d11jcrodjJxHbQfsVaO2eeRscElZCEW2NBjSN176YQqxfTKUZAtAd1FxlikpMEw0SrKorJ89TtQWj0zuXBH1m15ydvQo42sFOEormrKobfzXXTmHuR1Ip4dV8zjlWSZCPRP&userId=100005089685883&langId=1&callback=Ext.data.JsonP.callback5&_dc=1374837560572&","username":null,"password":null,"data":null,"headers":{"Accept":"*/*"},"timeout":60000,"type":"GET","boundary":null,"files":null,"fileUploadMethod":"multipart"}
D/Forge   (10634): Returned: {"content":"try{Ext.data.JsonP.callback5({\"status\":\"ok\",\"data\":{\"user\":{\"id\":100005089685883,\"isUser\":1,\"mutual\":0,\"name\":\"\\u0418\\u0432\\u0430\\u043d \\u0421\\u0442\\u0443\\u0434\\u0438\\u043e \\u0411\\u0438\\u0433\\u043c\\u0435\\u0439\\u0434\\u0436 \\u0412\\u0430\\u0440\\u043d\\u0430\",\"score\":0,\"coins\":\"3975\",\"version\":2,\"type\":\"free\"},\"games\":{\"waiting\":1,\"total\":1,\"checksum\":\"0b0e694b092ad4361bb76d74eb33cdc4\"},\"gamePriceFree\":500,\"gamePricePaid\":500,\"lastUpdate\":0,\"forceUpdate\":0,\"scoreHasUpdate\":0,\"itemsPerPage\":25},\"message\":\"\"});} catch(err) {}","callid":"BE6E4316-40C7-4484-A63B-9DBECDC1EA54","status":"success"}
I/Forge   (10634): Pausing webview while application not focussed.
D/Forge   (10634): Returned: {"event":"event.appPaused","params":null}
D/webviewglue(10634): nativeDestroy view: 0x4c16ad10

I've tried to init the app without anything and the error still persists. If I trigger forge.facebook.logout() anytime after re-opening the app - just crash. Trued everything I could think of. Even used

https://api.facebook.com/restserver.php?access_token=239450298&method=auth.expireSession&format=json

which was success but forge.facebook.authorize or hasAuth.. still return me the invalidated token and the only thing I can do is forge.facebook.logout() :)

From the support (for which we've paid extra) told us politely to frack off because their demo application with facebook is working ok and they were unable to reproduce the problem ... yet. Please if anyone experienced the same problem ... Do you need anything more? The code I'm using is as shown on their site - nothing more.

Oh and when I try to login with tabs using this code:

forge.tabs.openWithOptions({
    url: 'https://m.facebook.com/dialog/oauth?display=touch&client_id=1234970&scope=email%2Cfriends_about_me%2Cfriends_birthday%2Cfriends_hometown%2Cfriends_relationships%2Cfriends_work_history&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess',
    pattern: 'fbconnect://success',
    title: 'Login Page'
}, function (data) {

});

I get app crash with popup: "Unfortunately, AnotherInstalledApp has stopped."

I/Forge   (17044): Allowing another Android app to handle URL: fbconnect://success#access_token=CAAGM3jqOnesBACnD1tDaA85XvivpYxve9mLU5JTTKyGWX7TnoRCvdFQsYFup3uP8GJREnwQ5hJWsnwGRuLJIC1xyrata2SlrZAHK23nQFfhX8nD4Jw6GWzTd2MLTwJr3LD3EBMSjEWpCqyneumO3YgzVzoisZD&expires_in=5103179
I/ActivityManager( 2176): START u0 {act=android.intent.action.VIEW dat=fbconnect://success cmp=com.com2us.towerdefense.normal.freefull.google.global.android.common/com.com2us.hub.activity.ActivitySearchFriendsFacebook} from pid 17044
I/ActivityManager( 2176): Start proc com.com2us.towerdefense.normal.freefull.google.global.android.common for activity com.com2us.towerdefense.normal.freefull.google.global.android.common/com.com2us.hub.activity.ActivitySearchFriendsFacebook: pid=17261 uid=10084 gids={50084, 3003, 1015, 1028}

WTF?!

0

1 Answer 1

1

Update: with more information from Ivan, managed to track the crashing behaviour down to a bug in the Android Facebook SDK. Have included in our next version of the module, which went live as version 2.0.1 of that module.


Original answer:

I'll start with the openWithOptions problem: that looks like AnotherInstalledApp has also registered to handle URLs with scheme fbconnect. Using a different redirect URLs should address that - note it will need to be in your set of allowed URLs in the FB app configuration.

For the former IllegalArgumentException - as discussed by email we've not been able to recreate the problem using a simple app: if you are able to share your source with us, or a stripped-down version thereof, we'd be happy to work with it.

It would also be instructive to see if you get the same problem using that simple app, to determine if it's a problem in your development environment.

2
  • Won't be easier if you add try/catch exception for facebook.logout() ? Jul 29, 2013 at 10:44
  • AnotherInstalledApp is not mine at all but to the other developer (I think it's not even using forge). Also how come when I open tab inside trigger.io app, another app will handle the result?! I need fbconnect://success otherwise your tabs open the redirect url which I don't want because I'm searching for a solution which avoids using your forge.facebook method. Jul 29, 2013 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.