[英]facebook AppInviteContent: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first
[英]android - The SDK has not been initialized, make sure to call AccountKit.initialize() first
使用Facebook Account Kit時出現此錯誤。 當我調試程序時,方法Accountkit.GetCurrentAccessToken()!=null
導致此錯誤。 當我刪除此。 然后某個地方但不在我編寫的代碼中也會導致此錯誤。 我嘗試編輯manifest.xml,但沒有運氣。 誰能幫我解決這個問題?
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.featuring.beta.featuringbeta, PID: 26749
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.featuring.beta.featuringbeta/com.facebook.accountkit.ui.AccountKitActivity}: 500: Initialization error: 501: The SDK has not been initialized, make sure to call AccountKit.initialize() first
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2330)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5261)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:939)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:734)
Caused by: 500: Initialization error: 501: The SDK has not been initialized, make sure to call AccountKit.initialize() first
at com.facebook.accountkit.internal.Validate.sdkInitialized(Validate.java:53)
at com.facebook.accountkit.internal.Initializer.getLoginManager(Initializer.java:199)
謝謝。
注意,我使用Accountkit創建了一個新項目,效果很好。 當我將代碼放入項目中進行注冊和登錄時,它將導致此錯誤。
確保您像這樣在應用程序類中初始化帳戶工具包
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AccountKit.initialize(getApplicationContext());
}
}
之后在清單中
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.you.yourapp">
<application
android:name=".MyApplication"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.