添加facebook应用事件包flutter后Firebase动态链接缺少插件异常

Firebase dynamic links missing plugin exception after adding facebook app events package flutter

在我的 flutter 应用程序中,我实现了 firebase 动态 links 并且它运行良好。在我添加 facebook_app_events 包后,应用程序正常构建并 运行 但与 firebase 动态相关的任何东西 links 都无法正常工作并出现此错误:

Launching lib\main.dart on SM G930V in debug mode...
Plugin project :firebase_core_web not found. Please update settings.gradle.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
W/FlutterActivity( 8798): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@90d680) but could not find and invoke the GeneratedPluginRegistrant.
E/FlutterFcmService( 8798): Fatal: failed to find callback
Connecting to VM Service at ws://127.0.0.1:4725/ji05M87o10Q=/ws
D/libGLESv2( 8798): STS_GLApi : DTS, ODTC are not allowed for Package : qcard.club
I/flutter ( 8798): error:MissingPluginException(No implementation found for method FirebaseDynamicLinks#getInitialLink on channel plugins.flutter.io/firebase_dynamic_links)
I/zygote64( 8798): Do partial code cache collection, code=60KB, data=47KB
I/zygote64( 8798): After code cache collection, code=60KB, data=47KB
I/zygote64( 8798): Increasing code cache capacity to 256KB

删除 facebook 应用程序事件包后一切 returns 恢复正常。我已经在 github 上打开了一个问题,但它确实产生了很多信息。这是对它的link: https://github.com/FirebaseExtended/flutterfire/issues/3092

更新:

我的 strings.xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="facebook_app_id">app_id</string>
</resources>

Androidmanifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.qcard"
    xmlns:tools="http://schemas.android.com/tools">>
    
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="Qcard"
        android:icon="@mipmap/ic_launcher"
        tools:replace="android:label">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
              <action android:name="FLUTTER_NOTIFICATION_CLICK" />
              <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name="com.apptreesoftware.flutterwebview.WebViewActivity">
</activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
     <meta-data
          android:name="com.facebook.sdk.ApplicationId"
          android:value="@string/facebook_app_id"/>
</manifest>

首先,Facebook 应用程序 ID meta-data 应该在 您的 <application> 标签。

查看粘贴的 Android Manifest 的底部并将其更改为

    <meta-data
      android:name="flutterEmbedding"
      android:value="2" />

    <meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id"/>
  </application>
</manifest>

其次,我不确定您是否只是混淆了您的 Facebook ID,或者您的意思是您确实将 app_id 作为您的 Facebook 应用程序 ID?

您的 facebook App ID 应该是一串 16 位数字。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="facebook_app_id">1122334455667788</string>
</resources>