2016-11-09 2 views
0

Ich habe Konto-Kit in meiner App integriert und es funktioniert für die meisten Geräte. Aber ich bekomme auch einige Absturzberichte für die SDK-Initialisierung. Kann jemand herausfinden, was ich falsch mache?Facebook Konto Kit Initialisierung Problem + Java

Fehler:

com.facebook.accountkit.ui.AccountKitActivity}: 500: Initialization error: 501: The SDK has not been initialized, make sure to call AccountKit.initializeSdk() first : at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2286) Caused by: 500: Initialization error: 501: The SDK has not been initialized, make sure to call AccountKit.initializeSdk() first at com.facebook.accountkit.internal.Validate.sdkInitialized(Validate.java:82)

public class PhoneRegActivity extends Activity { 
    //variables 
     @Override 
    protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
     com.facebook.accountkit.AccountKit.initialize(getApplicationContext()); 
    setContentView(R.layout.phone_reg); 
    accessToken = AccountKit.getCurrentAccessToken(); 
    SharedPreferences settings = getSharedPreferences("prefs", 0); 
    ///codes 
     } 
     } 

Jeder möglicher Vorschlag sehr

Antwort

0

Es gibt eine andere Version von AccountKit.initialize zu erkennen, dass ein Rückruf erfolgt.

public static void initialize(android.content.Context applicationContext, 
          AccountKit.InitializeCallback callback) 

Sie könnten diesen verwenden und auf den Rückruf warten, bevor Sie versuchen, das Zugriffstoken zu erhalten.

Alternativ könnten Sie versuchen, AccountKit etwas früher zu initialisieren, indem Sie es in Ihrer Anwendungsklasse initialisieren und sehen, ob das hilft.