java.lang.IllegalStateException: Orca SharedPreferences used before initialized

强颜欢笑 提交于 2019-12-04 06:09:09

We finally fixed this issue by catching the exception and avoiding that devices without an installed facebook app got activated. A facebook developer answered us:

"The user needs to have the Facebook Android app installed on their device and logged in for activateApp to function properly."

This is the code we finally used and it isn´t crashing anymore:

try{
        /* Only activate FaceBook publish install if the user has the FaceBook app installed */
        if (com.facebook.Settings.getAttributionId(getContentResolver()) != null){
        com.facebook.AppEventsLogger.activateApp(this);
        }
    } catch (IllegalStateException e){
        Log.d(TAG, "Facebook Setting Exception again!");
    }

I hope this helps others...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!