darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
197 stars 142 forks source link

MissingPluginException #280

Closed rahmanrezaee closed 2 years ago

rahmanrezaee commented 2 years ago

What version are you using?

4.4.1

What OS and version are you using to local deploy your application?

Window 10

What platforms are you seeing the problem on?

Android

pubspec.yaml

name: test_app
description: A new Flutter project.
publish_to: "none"
version: 1.0.0+1
environment:
  sdk: ">=2.17.0 <3.0.0"

dependencies:
  audio_session: ^0.1.7
  audio_waveforms: ^0.1.4
  badges: null
  better_player: null
  bot_toast: ^4.0.0
  cached_network_image: ^3.1.0
  connectivity_plus: ^2.3.0
  country_code_picker: ^2.0.2
  cupertino_icons: ^1.0.2
  device_info: ^2.0.2
  dio: ^4.0.6
  dio_http_cache: ^0.3.0
  easy_localization: ^3.0.0
  feather_icons: null
  firebase_auth: ^3.3.11
  firebase_core: ^1.11.0
  firebase_messaging: ^12.0.1

  flutter:
    sdk: flutter
  flutter_contacts: ^1.1.4
  flutter_facebook_auth: ^4.4.1
  flutter_fortune_wheel: ^1.1.0
  flutter_html: ^3.0.0-alpha.5
  flutter_local_notifications: ^9.2.0
  flutter_mobx: ^2.0.6+1
  flutter_modular: ^5.0.3
  flutter_phoenix: ^1.0.0
  flutter_portal: ^1.1.1
  flutter_slidable: ^2.0.0
  flutter_sound: ^9.2.13
  flutter_staggered_grid_view: ^0.6.1
  flutter_svg: ^1.1.1+1
  flutter_typeahead: ^4.0.0
  font_awesome_flutter: ^10.1.0
  freezed_annotation: ^0.15.0
  geolocator: ^9.0.1
  google_maps_flutter: ^2.1.4
  google_place: ^0.4.3
  google_sign_in: ^5.1.1
  http: ^0.13.3
  iconsax: null
  image_cropper: ^2.0.3
  image_picker: ^0.8.4
  incrementally_loading_listview: ^1.0.0
  intl: ^0.17.0
  jiffy: ^5.0.0
  just_audio: ^0.9.28
  just_waveform: ^0.0.3
  lottie: null
  mobile_scanner: ^2.0.0
  mobx: ^2.0.7+5
  multi_image_picker: ^4.6.5
  overlay_support: ^2.0.1
  path_provider: ^2.0.8
  permission_handler: ^10.0.0
  photo_view: ^0.14.0
  pinput: ^2.2.11
  qr_flutter:
    git:
      url: https://github.com/ahzf/qr.flutter.git
  quiver: ^3.0.1
  rxdart: ^0.27.5
  scroll_to_index: ^3.0.1
  shared_preferences: ^2.0.7
  sign_in_with_apple: 4.1.0
  socket_io_client: ^2.0.0-beta.2
  url_launcher: ^6.0.20
  uuid: ^3.0.6
  webview_flutter_plus: ^0.3.0+2
  dotted_border: ^2.0.0+2

  calendar_date_picker2: 
    git:
      url: https://github.com/rahmanrezaee/calendar_date_picker2.git
      ref: main 
  sqflite: ^2.0.3+1

dev_dependencies:
  build_runner: null
  flutter_launcher_icons: "^0.9.2"
  flutter_native_splash: ^2.2.0+1
  flutter_test:
    sdk: flutter
  freezed: ^0.14.2
  json_serializable: ^4.1.4
  mobx_codegen: null
flutter_native_splash:
  color: "#FFFFFF"
  image: "assets/images/logo_splash.png"
  fill: true
flutter:
  uses-material-design: true
  assets:
    - assets/
    - assets/translations/
    - assets/icons/svg/
    - assets/images/
    - assets/icons/
    - assets/flags/
    - assets/db/

  fonts:
    - family: Montserrat
      fonts:
        - asset: assets/fonts/Montserrat-Black.ttf
        - asset: assets/fonts/Montserrat-ExtraBold.ttf
        - asset: assets/fonts/Montserrat-Bold.ttf
        - asset: assets/fonts/Montserrat-SemiBold.ttf
        - asset: assets/fonts/Montserrat-Medium.ttf
        - asset: assets/fonts/Montserrat-Italic.ttf
        - asset: assets/fonts/Montserrat-Regular.ttf
        - asset: assets/fonts/Montserrat-Light.ttf
        - asset: assets/fonts/Montserrat-ExtraLight.ttf
        - asset: assets/fonts/Montserrat-Thin.ttf
    - family: iranSans
      fonts:
        - asset: assets/fonts/IRANSans-Bold.ttf
        - asset: assets/fonts/IRANSans-Light.ttf
        - asset: assets/fonts/IRANSans-Medium.ttf
        - asset: assets/fonts/IRANSans-Regular.ttf
        - asset: assets/fonts/IRANSans-UltraLight.ttf

Describe the Bug

Before upgrading flutter SDK(2.10.0) its worked fine, after upgrading to (3.0,5) its shows this error.

Expected Behavior

I clean the dependency and clear the cache still show that error

To Reproduce

this code which I use.

      final LoginResult result =
                await FacebookAuth.instance.login(
              permissions: [
                'public_profile',
                'email',
                'user_link',
              ],
            );
         print("result ${result.accessToken}");

Relevant log output

[ +223 ms] E/flutter ( 9563): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for
method login on channel app.meedu/flutter_facebook_auth)
[   +4 ms] E/flutter ( 9563): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
[   +1 ms] E/flutter ( 9563): <asynchronous suspension>
[   +1 ms] E/flutter ( 9563): #1      FacebookAuthPlatformImplementation.login
(package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:34:22)
[   +1 ms] E/flutter ( 9563): <asynchronous suspension>
[        ] E/flutter ( 9563): #2      _SocialMediaFormPageState.build.<anonymous closure>.<anonymous closure>
(package:dast_ba_dast/app/modules/profile_module/pages/social_media/social_media_form.dart:129:41)
[   +1 ms] E/flutter ( 9563): <asynchronous suspension>
[        ] E/flutter ( 9563):

flutter doctor -v

[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1889], locale en-US)
    • Flutter version 3.0.5 at G:\flutter\setup\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (7 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at G:\flutter\setup\Sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.11.10)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
    • Visual Studio Professional 2019 version 16.11.32126.315
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[√] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.3
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.70.2)
    • VS Code at C:\Users\RahmanRezae\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (4 available)
    • SM A307GN (mobile) • RR8MB0C3D1P • android-arm64  • Android 11 (API 30)
    • Windows (desktop)  • windows     • windows-x64    • Microsoft Windows [Version 10.0.19044.1889]
    • Chrome (web)       • chrome      • web-javascript • Google Chrome 104.0.5112.102
    • Edge (web)         • edge        • web-javascript • Microsoft Edge 104.0.1293.70

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Info.plist (iOS)

No response

Podfile (iOS)

No response

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ads.adsad">

    <queries>

        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>

        <intent>
            <action android:name="android.intent.action.DIAL" />
            <data android:scheme="tel" />
        </intent>

        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="*/*" />
        </intent>
        <provider android:authorities="com.facebook.katana.provider.PlatformProvider" />

    </queries>

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

    <application
        android:label="xxxx"
        android:extractNativeLibs="true"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:largeHeap="true"
        android:exported="true"
        android:hardwareAccelerated="false"
        android:name="androidx.multidex.MultiDexApplication"
        android:icon="@mipmap/ic_launcher">

        <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="xxxxxxxxxx"/>
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
        <activity android:name="com.facebook.FacebookActivity"
          android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
          android:label="@string/app_name" />

        <activity
          android:name="com.facebook.CustomTabActivity"
          android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <activity android:name="clancey.simpleauth.simpleauthflutter.SimpleAuthCallbackActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="myflutterapp.com" />
            </intent-filter>
        </activity>
        <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. -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity
          android:name="com.yalantis.ucrop.UCropActivity"
          android:screenOrientation="portrait"
          android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
        <!-- 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>
</manifest>

MainActivity.java

No response

MainActivity.kt

package com.webfume.distbadist

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {

}

index.html

No response

Info.plist (macOS)

No response

rahmanrezaee commented 2 years ago

I solved I forget the new config this meta data and also remove the extra activity of facebook dialogs

<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>