The problem
The first time I call FB.Login I'm redirected to facebook but then there seems to be a problem with coming back to my app. I'm getting the message "[App name] has stopped working." I've posted a screenshot of the stacktrace further down.
If I after that crash open my game I can see that I am logged in and can do what I want (Invite friends etc.). But if I log out and then in again, the same problem occurs.
Additional info
- I'm certain that I've got the hash key set up correctly, otherwise I wouldn't be able to call those other fb functions.
- My manifest.xml is using the FBUnityPlayerActivity activity and I'm not extending UnityPlayerActivity in some other activity.
- It looks like I'm coming back to my app for a split second before the screen goes black and the crash happens.
- I'm using Facebook for Unity SDK 4.3.4, although I have tried 4.3.3 and 4.2.4. I'm seeing the same error on every version.
- On the app page on facebook, the package name is correct and the Class is com.facebook.unity.FBUnityPlayerActivity.
- Out of maybe 30 tries, one time I actually got back to my game after logging in. Without changing any code, next time I tried, it crashed.
- I've tried to remove all of my scenes and only run the facebook example scene. Everything works in this case. (I later found out that this only works when runnning in portrait mode.)
- Everything works on iOS. This error is just Android.
Suspicion
Of course I googled the stack trace, and it seems there's a similar problem here and here. From the SDK for Unity release notes, I noticed that even the latest version of the sdk uses Facebook for Android SDK 3.5.0, which points towards the same issue as the question I linked to. If that is indeed the case, is it possible for me to swap the underlying facebook for android sdk in the facebook for unity sdk and update it to a newer version myself?
Stacktrace