我正在模拟器上运行应用程序,并且应用程序崩溃了。一切都很完美。这个问题是在我尝试颤振清洁之前发生的,这比一切都还完美,但是现在颤振清洁也无法正常工作。 这是控制台
Launching lib\main.dart on SM G920W8 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
D/DynamitePackage( 9839): Instantiated singleton DynamitePackage.
D/DynamitePackage( 9839): Instantiating com.google.android.gms.ads.reward.ChimeraRewardedVideoAdCreatorImpl
D/NetworkSecurityConfig( 9839): No Network Security Config specified, using platform default
I/Ads ( 9839): Updating ad debug logging enablement.
D/AndroidRuntime( 9839): Shutting down VM
E/AndroidRuntime( 9839): FATAL EXCEPTION: main
E/AndroidRuntime( 9839): Process: com.example.gtvsports, PID: 9839
E/AndroidRuntime( 9839): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gtvsports/com.example.gtvsports.MainActivity}: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
E/AndroidRuntime( 9839): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
E/AndroidRuntime( 9839): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
E/AndroidRuntime( 9839): at android.app.ActivityThread.-wrap14(ActivityThread.java)
E/AndroidRuntime( 9839): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
E/AndroidRuntime( 9839): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 9839): at android.os.Looper.loop(Looper.java:154)
E/AndroidRuntime( 9839): at android.app.ActivityThread.main(ActivityThread.java:6682)
E/AndroidRuntime( 9839): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9839): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
E/AndroidRuntime( 9839): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
E/AndroidRuntime( 9839): Caused by: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
E/AndroidRuntime( 9839): at com.facebook.internal.Validate.sdkInitialized(Validate.java:144)
E/AndroidRuntime( 9839): at com.facebook.login.LoginManager.<init>(LoginManager.java:80)
E/AndroidRuntime( 9839): at com.facebook.login.LoginManager.getInstance(LoginManager.java:93)
E/AndroidRuntime( 9839): at com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin$FacebookSignInDelegate.<init>(FacebookLoginPlugin.java:109)
E/AndroidRuntime( 9839): at com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin.<init>(FacebookLoginPlugin.java:38)
E/AndroidRuntime( 9839): at com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin.registerWith(FacebookLoginPlugin.java:42)
E/AndroidRuntime( 9839): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:27)
E/AndroidRuntime( 9839): at com.example.gtvsports.MainActivity.onCreate(MainActivity.java:11)
E/AndroidRuntime( 9839): at android.app.Activity.performCreate(Activity.java:6942)
E/AndroidRuntime( 9839): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
E/AndroidRuntime( 9839): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
E/AndroidRuntime( 9839): ... 9 more
Syncing files to device SM G920W8...
E/Ads ( 9839): Fail to get isAdIdFakeForDebugLogging
E/Ads ( 9839): java.io.IOException: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
E/Ads ( 9839): at com.google.android.gms.ads.identifier.b.a(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:67)
E/Ads ( 9839): at com.google.android.gms.ads.internal.util.e.d_(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:4)
E/Ads ( 9839): at com.google.android.gms.ads.internal.util.c.run(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:3)
E/Ads ( 9839): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
E/Ads ( 9839): at adj.a(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:1)
E/Ads ( 9839): at act.run(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:3)
E/Ads ( 9839): at adk.run(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:2)
E/Ads ( 9839): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
E/Ads ( 9839): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
E/Ads ( 9839): at java.lang.Thread.run(Thread.java:762)
E/Ads ( 9839): Caused by: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
E/Ads ( 9839): at com.google.android.gms.ads.identifier.b.a(:com.google.android.gms.policy_ads_fdr_dynamite@20461000@20461000.264725060.264725060:68)
E/Ads ( 9839): ... 9 more
W/Ads ( 9839): Update ad debug logging enablement as false
答案 0 :(得分:0)
在使用FacebookSdk
之前,需要先调用此函数。
FacebookSdk.sdkInitialize();