darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
193 stars 127 forks source link

MissingPluginException #290

Closed shahid31346 closed 1 year ago

shahid31346 commented 1 year ago

What version are you using?

^5.0.0-dev.4

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

windows 10

What platforms are you seeing the problem on?

Android

pubspec.yaml

name: foodybite
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_rating_bar: ^4.0.0
  shared_preferences: ^2.0.13
  flutter_bloc: ^8.0.1
  equatable: ^2.0.3
  flutter_staggered_grid_view: ^0.6.1
  photo_view: ^0.13.0
  easy_localization: ^3.0.0
  shimmer: ^2.0.0
  package_info_plus: ^1.3.0
  fluttertoast: ^8.0.8
  url_launcher: ^6.0.18
  video_player: ^2.4.7
  modal_bottom_sheet: ^2.0.0
  #flutter_qr_bar_scanner: ^2.0.0
  image_picker: ^0.8.4+4
  mime: ^1.0.1
  chewie: ^1.2.2
  flutter_signin_button: ^2.0.0
  google_sign_in: ^5.4.1
  firebase_auth: ^3.3.8
  firebase_core: ^1.12.0
  cloud_firestore: ^3.1.6
  linkedin_login: ^2.2.1
  flutter_facebook_auth: ^5.0.0-dev.4
  permission_handler: ^10.0.2

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.4

dev_dependencies:
  flutter_test:
    sdk: flutter

dependency_overrides:
  platform: ^3.1.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/
    - assets/images/1.5x/
    - assets/images/2.0x/
    - assets/images/3.0x/
    - assets/images/4.0x/
    - assets/languages/

  fonts:
    - family: JosefinSans
      fonts:
        - asset: assets/fonts/JosefinSans-Regular.ttf
          weight: 400
        - asset: assets/fonts/JosefinSans-SemiBold.ttf
          weight: 500
        - asset: assets/fonts/JosefinSans-Bold.ttf
          weight: 700

Describe the Bug

i configure every as per your documentation but still no implementation found

Expected Behavior

facebook successfull login and info

i did everything flutter clean keyhash new config strings.xml

To Reproduce

loginFb() async {

//final LoginResult result = await FacebookAuth.instance.login();

final result =
    await FacebookAuth.i.login(permissions: ['public_profile']);
if (result.status == LoginStatus.success) {
  final userData = await FacebookAuth.i.getUserData();
  print(userData);
}

final _userData = await FacebookAuth.instance.getUserData();
print(_userData);

}

Relevant log output

E/flutter (30021): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method login on channel app.meedu/flutter_facebook_auth)
E/flutter (30021): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter (30021): <asynchronous suspension>
E/flutter (30021): #1      FacebookAuthPlatformImplementation.login (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:34:22)     
E/flutter (30021): <asynchronous suspension>
E/flutter (30021): #2      _LoginPageState.loginFb (package:foodybite/pages/login/login_page.dart:185:9)
E/flutter (30021): <asynchronous suspension>

flutter doctor -v

[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.19044.1826], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.15)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.71.2)
[√] Connected device (5 available)
[√] HTTP Host Availability

Info.plist (iOS)

No response

Podfile (iOS)

No response

AndroidManifest.xml

No response

MainActivity.java

No response

MainActivity.kt

No response

index.html

No response

Info.plist (macOS)

No response

darwin-morocho commented 1 year ago

@shahid31346 please add your AndroidManifest and your MainActivity

nambv commented 1 year ago

@darwin-morocho I'm facing the same problem too, in Android only

darwin-morocho commented 1 year ago

@darwin-morocho I'm facing the same problem too, in Android only

https://github.com/darwin-morocho/flutter-facebook-auth/issues/290#issuecomment-1267116353

nambv commented 1 year ago

ah @darwin-morocho problem solved. I add facebook client token into manifest & it's worked!

tovidd commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining.

AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}
Basemshawwa commented 1 year ago

same issue any help?

darwin-morocho commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining.

AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}

@tovidd your Android Manifest is wrong. You must remove

<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

also the meta tags must be inside the application tag. Please check https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml

Also you don't need implementation 'com.facebook.android:facebook-login' in your build.gradle

darwin-morocho commented 1 year ago

same issue any help?

@Basemshawwa please add your AndroidManifest and your MainActivity

tovidd commented 1 year ago

@darwin-morocho i have removed FacebookActivity, CustomTabActivity, & takeout implementation 'com.facebook.android:facebook-login' as you said, sadly it still error. Does the error come from pubspec.yaml ?

pubspec.yaml name: flutter_apps description: A new Flutter application. version: 1.0+1 environment: sdk: ">=2.6.0 <3.0.0" dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter add_2_calendar: ^2.1.3 #latest adjust_sdk: ^4.31.0 #latest app_review: ^2.1.1+1 auto_size_text: ^3.0.0 call_log: ^3.2.1 camera: ^0.8.1 carousel_slider: ^4.0.0 country_pickers: ^2.0.0 cupertino_icons: ^1.0.3 device_calendar: ^4.2.0 #latest device_info: ^2.0.0 dio: ^4.0.6 equatable: ^2.0.3 expandable: ^5.0.1 expandable_bottom_sheet: ^1.0.0+2 firebase_analytics: ^9.3.7 #latest firebase_auth: ^3.11.1 #latest firebase_core: ^1.24.0 #latest firebase_crashlytics: ^2.8.12 #latest firebase_messaging: ^13.0.4 #latest firebase_performance: ^0.8.3+2 #latest flare_flutter: ^3.0.0 flutter_bloc: ^8.0.1 flutter_card_swipper: ^0.4.0 flutter_datetime_picker: ^1.5.1 flutter_exif_rotation: ^0.4.1 flutter_facebook_auth: ^4.4.1+1 flutter_html: ^2.2.0 flutter_image_compress: ^1.0.0 flutter_inappwebview: ^5.3.2 flutter_jailbreak_detection: ^1.8.0 flutter_local_notifications: ^8.0.0 flutter_rating_bar: ^4.0.0 flutter_screenutil: ^5.3.1 flutter_spinkit: ^5.0.0 flutter_svg: ^0.22.0 flutter_widget_from_html: ^0.6.1 fluttertoast: ^8.0.6 gallery_saver: ^2.3.1 get_it: ^7.2.0 geocoding: ^2.0.4 geolocator: ^8.2.1 google_mobile_ads: ^2.0.1 #latest google_sign_in: ^5.4.2 #latest http: ^0.13.3 image: ^3.0.8 image_cropper: ^1.4.0 image_gallery_saver: ^1.7.1 image_picker: ^0.8.5+3 in_app_review: ^2.0.2 intl: ^0.17.0 launch_review: ^3.0.1 logger: ^1.1.0 lottie: ^1.0.1 matrix4_transform: ^2.0.0 mockito: ^5.0.7 multi_image_picker: ^4.8.01 native_shared_preferences: ^2.0.3 numberpicker: ^2.1.1 package_info: ^2.0.0 palette_generator: ^0.3.0 path_drawing: ^0.5.0 path_provider: ^2.0.11 percent_indicator: ^4.0.0 permission_handler: 10.0.0 photo_view: ^0.13.0 provider: ^6.0.2 pull_to_refresh: ^2.0.0 qr_code_scanner: ^1.0.1 #latest random_color: ^1.0.6-nullsafety rate_my_app: ^1.1.0+1 rxdart: ^0.27.0 screenshot: ^1.2.3 scroll_to_index: ^2.0.0 share: ^2.0.1 share_extend: ^2.0.0 shared_preferences: ^2.0.5 shimmer: ^2.0.0 showcaseview: ^1.0.0 sign_in_with_apple: ^4.1.0 #latest simple_animations: ^3.1.1 simple_gesture_detector: ^0.2.0 store_redirect: ^2.0.0 timeline_tile: ^2.0.0 timezone: ^0.8.0 tutorial_coach_mark: ^1.0.3 ua_client_hints: ^1.1.0 url_launcher: ^6.1.4 uuid: ^3.0.6 vector_math: ^2.1.0 video_player: ^2.1.1 visibility_detector: ^0.3.3 #latest web_socket_channel: ^2.2.0 webview_flutter: 2.0.7 youtube_player_flutter: ^8.0.0 dev_dependencies: flutter_test: sdk: flutter flutter_driver: sdk: flutter flutter_launcher_icons: "^0.9.0" android: true ios: true flutter: uses-material-design: true

and is it fine if <queries> contain <provider> & <intent> ?

<queries>
     <provider
          android:authorities="com.facebook.katana.provider.PlatformProvider"
          android:exported="true" />
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="https" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="tel" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="sms" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="whatsapp" />
     </intent>
</queries>
darwin-morocho commented 1 year ago

@darwin-morocho i have removed FacebookActivity, CustomTabActivity, & takeout implementation 'com.facebook.android:facebook-login' as you said, sadly it still error. Does the error come from pubspec.yaml ?

pubspec.yaml and is it fine if <queries> contain <provider> & <intent> ?

<queries>
     <provider
          android:authorities="com.facebook.katana.provider.PlatformProvider"
          android:exported="true" />
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="https" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="tel" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="sms" />
     </intent>
     <intent>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="whatsapp" />
     </intent>
</queries>

the queries tag only can allows provider tags please add your complete AndroidManifest. Sorry but if you don't provide that file I not able to help you

tovidd commented 1 year ago

Here @darwin-morocho

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.VIDEO_CAPTURE" />
    <uses-permission android:name="android.permission.AUDIO_CAPTURE" />

    <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />

    <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" />-->

    <queries>
        <provider
            android:authorities="com.facebook.katana.provider.PlatformProvider"
            android:exported="true" />
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="tel" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="sms" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="whatsapp" />
        </intent>
    </queries>

    <application
        android:name=".MyApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="My apps"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup,icon,label,name"
        tools:node="replace">

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

        <activity
            android:name="com.aboutyou.dart_packages.sign_in_with_apple.SignInWithAppleCallback"
            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="signinwithapple" />
                <data android:path="callback" />
            </intent-filter>
        </activity>

        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:launchMode="singleTask"
            android:theme="@style/LaunchTheme"
            android:resizeableActivity="true"
            android:supportsPictureInPicture="true"
            android:exported="true"
            android:windowSoftInputMode="adjustResize">
            <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>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="www.apps.com" android:pathPrefix="/path"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="*.apps.com" android:pathPrefix="/path"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="apps" android:host="redirection"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="delivery_metrics_exported_to_big_query_enabled"
            android:value="true" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_notification" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/purple" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/channel" />
        <meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true" />
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/gms_app_id" />

        <meta-data
            android:name="firebase_performance_logcat_enabled"
            android:value="true" />

<!--        <activity-->
<!--            android:name="com.facebook.FacebookActivity"-->
<!--            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"-->
<!--            android:exported="true"-->
<!--            android:label="@string/app_name" />-->
<!--        <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"-->
<!--            android:value="true"/>>-->
<!--        <meta-data android:name="com.facebook.sdk.AutoInitEnabled"-->
<!--            android:value="true"/>-->

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

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/gms_version" />

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:exported="true"
            android:theme="@android:style/Theme.Translucent" />

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

        <receiver
            android:name="com.adjust.sdk.AdjustReferrerReceiver"
            android:exported="true"
            android:permission="android.permission.INSTALL_PACKAGES">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.firebase.components.ComponentDiscoveryService"
            android:directBootAware="true"
            android:exported="true">
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.crashlytics.CrashlyticsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar"/>
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.perf.FirebasePerfRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.remoteconfig.RemoteConfigRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.abt.component.AbtRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar"/>
        </service>

        <service
            android:name="com.google.android.datatransport.runtime.backends.TransportBackendDiscovery"
            android:exported="false">
            <meta-data
                android:name="backend:com.google.android.datatransport.cct.CctBackendFactory"
                android:value="cct"/>
        </service>

        <service
            android:name="com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" >
        </service>

        <activity
            android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
            android:screenOrientation="portrait"
            android:exported="true"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

    </application>
</manifest>

flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel unknown, 3.3.2, on macOS 12.6 21G115 darwin-x64, locale en-ID) ! Flutter version 3.3.2 on channel unknown at /Users/username/Development/flutter ! Upstream repository unknown [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.3) [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.71.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

! Doctor found issues in 2 categories.

darwin-morocho commented 1 year ago

Here @darwin-morocho

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.VIDEO_CAPTURE" />
    <uses-permission android:name="android.permission.AUDIO_CAPTURE" />

    <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />

    <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" />-->

    <queries>
        <provider
            android:authorities="com.facebook.katana.provider.PlatformProvider"
            android:exported="true" />
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="tel" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="sms" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="whatsapp" />
        </intent>
    </queries>

    <application
        android:name=".MyApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="My apps"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup,icon,label,name"
        tools:node="replace">

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

        <activity
            android:name="com.aboutyou.dart_packages.sign_in_with_apple.SignInWithAppleCallback"
            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="signinwithapple" />
                <data android:path="callback" />
            </intent-filter>
        </activity>

        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:launchMode="singleTask"
            android:theme="@style/LaunchTheme"
            android:resizeableActivity="true"
            android:supportsPictureInPicture="true"
            android:exported="true"
            android:windowSoftInputMode="adjustResize">
            <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>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="www.apps.com" android:pathPrefix="/path"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="*.apps.com" android:pathPrefix="/path"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="apps" android:host="redirection"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="delivery_metrics_exported_to_big_query_enabled"
            android:value="true" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_notification" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/purple" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/channel" />
        <meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true" />
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/gms_app_id" />

        <meta-data
            android:name="firebase_performance_logcat_enabled"
            android:value="true" />

<!--        <activity-->
<!--            android:name="com.facebook.FacebookActivity"-->
<!--            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"-->
<!--            android:exported="true"-->
<!--            android:label="@string/app_name" />-->
<!--        <meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"-->
<!--            android:value="true"/>>-->
<!--        <meta-data android:name="com.facebook.sdk.AutoInitEnabled"-->
<!--            android:value="true"/>-->

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

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/gms_version" />

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:exported="true"
            android:theme="@android:style/Theme.Translucent" />

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

        <receiver
            android:name="com.adjust.sdk.AdjustReferrerReceiver"
            android:exported="true"
            android:permission="android.permission.INSTALL_PACKAGES">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.firebase.components.ComponentDiscoveryService"
            android:directBootAware="true"
            android:exported="true">
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.crashlytics.CrashlyticsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar"/>
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.perf.FirebasePerfRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.remoteconfig.RemoteConfigRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.abt.component.AbtRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar"/>
        </service>

        <service
            android:name="com.google.android.datatransport.runtime.backends.TransportBackendDiscovery"
            android:exported="false">
            <meta-data
                android:name="backend:com.google.android.datatransport.cct.CctBackendFactory"
                android:value="cct"/>
        </service>

        <service
            android:name="com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" >
        </service>

        <activity
            android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
            android:screenOrientation="portrait"
            android:exported="true"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

    </application>
</manifest>

flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel unknown, 3.3.2, on macOS 12.6 21G115 darwin-x64, locale en-ID) ! Flutter version 3.3.2 on channel unknown at /Users/username/Development/flutter ! Upstream repository unknown [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.3) [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.71.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

! Doctor found issues in 2 categories.

Your AndroidManifest looks good. Could you try to use android:name="${applicationName}" in your application tag? Also it seems a custom MainApplication or a custom MainActivity that theybare locking the plugin registration

tovidd commented 1 year ago

Your AndroidManifest looks good. Could you try to use android:name="${applicationName}" in your application tag? Also it seems a custom MainApplication or a custom MainActivity that theybare locking the plugin registration

Only custom MainActivity.java to configure Adjust tracker. MainApplication.java using default class.

The error still exist after changed the tag to android:name="${applicationName}"

tovidd commented 1 year ago

I got error when register plugin in debug mode @darwin-morocho.


W/FlutterEngineCxnRegstry: Attempted to register plugin (io.flutter.plugins.firebase.performance.FlutterFirebasePerformancePlugin@599337d) but it was already registered with this FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7634e10).
W/FlutterEngineCxnRegstry: Attempted to register plugin (io.flutter.plugins.flutterexifrotation.FlutterExifRotationPlugin@f993272) but it was already registered with this FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7634e10).
E/GeneratedPluginRegistrant: Error registering plugin flutter_facebook_auth, app.meedu.flutter_facebook_auth.FlutterFacebookAuthPlugin
    The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
        at com.facebook.internal.Validate.sdkInitialized(Validate.kt:129)
        at com.facebook.login.LoginManager.<init>(LoginManager.kt:1398)
        at com.facebook.login.LoginManager$Companion.getInstance(LoginManager.kt:1319)
        at com.facebook.login.LoginManager.getInstance(Unknown Source:2)
        at app.meedu.flutter_facebook_auth.FacebookAuth.<init>(FacebookAuth.java:27)
        at app.meedu.flutter_facebook_auth.FlutterFacebookAuthPlugin.<init>(FlutterFacebookAuthPlugin.java:20)
        at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:94)
        at com.temanbumil.android.MainActivity.configureFlutterEngine(MainActivity.java:41)
        at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:205)
        at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:498)
        at com.temanbumil.android.MainActivity.onCreate(MainActivity.java:139)
        at android.app.Activity.performCreate(Activity.java:8051)
        at android.app.Activity.performCreate(Activity.java:8031)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

This shouldn't be happen because FacebookSdk.sdkInitialize(getApplicationContext()); is deprecated. And only need <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>.

shahid31346 commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining. AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}

@tovidd your Android Manifest is wrong. You must remove

<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

also the meta tags must be inside the application tag. Please check https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml

Also you don't need implementation 'com.facebook.android:facebook-login' in your build.gradle

thank you , now the dialog appears for 1 second and then gone with error ( SERVER_ERROR: [code] 1675030 [message]: Error performing query. [extra]:)

darwin-morocho commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining. AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}

@tovidd your Android Manifest is wrong. You must remove

<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

also the meta tags must be inside the application tag. Please check https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml Also you don't need implementation 'com.facebook.android:facebook-login' in your build.gradle

thank you , now the dialog appears for 1 second and then gone with error ( SERVER_ERROR: [code] 1675030 [message]: Error performing query. [extra]:)

It seems that you are using a real user to sign in with facebook, if your app is in develop mode you shoud use a test user or use the user who created the facebook app.

https://stackoverflow.com/questions/41861564/server-error-code-1675030-message-error-performing-query

shahid31346 commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining. AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}

@tovidd your Android Manifest is wrong. You must remove

<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

also the meta tags must be inside the application tag. Please check https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml Also you don't need implementation 'com.facebook.android:facebook-login' in your build.gradle

thank you , now the dialog appears for 1 second and then gone with error ( SERVER_ERROR: [code] 1675030 [message]: Error performing query. [extra]:)

It seems that you are using a real user to sign in with facebook, if your app is in develop mode you shoud use a test user or use the user who created the facebook app.

https://stackoverflow.com/questions/41861564/server-error-code-1675030-message-error-performing-query

yeah i checked that, but its working fine with test users on LoginBehavior.webOnly, but on other dehaviors the dialog is disappearing after one second, what should i do now, i appreciate your help thank you very much.

darwin-morocho commented 1 year ago

No issue on iOS, but Android error on both login & logout:

E/flutter ( 5774): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method logOut on channel app.meedu/flutter_facebook_auth)
E/flutter ( 5774): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 5774): <asynchronous suspension>
E/flutter ( 5774): #1      FacebookAuthPlatformImplementation.logOut (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:87:5)
E/flutter ( 5774): <asynchronous suspension>

I have followed https://facebook.meedu.app/docs/4.x.x/android. Error still remaining. AndroidManifest.xml

<queries>
   <package android:name="com.facebook.katana" />
   <provider
      android:authorities="com.facebook.katana.provider.PlatformProvider"
      android:exported="true" />
   <provider
      android:authorities="com.facebook.orca.provider.PlatformProvider"
      android:exported="true" />
</queries>
<meta-data
      android:name="com.facebook.sdk.ApplicationId"
      android:value="@string/facebook_app_id" />
<meta-data
      android:name="com.facebook.sdk.ClientToken"
      android:value="@string/facebook_client_token" />
<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

android/app/build.gradle

dependencies {
        . . .
    implementation 'com.facebook.android:facebook-login'
}

@tovidd your Android Manifest is wrong. You must remove

<activity
      android:name="com.facebook.FacebookActivity"
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
      android:exported="true"
      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>

also the meta tags must be inside the application tag. Please check https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml Also you don't need implementation 'com.facebook.android:facebook-login' in your build.gradle

thank you , now the dialog appears for 1 second and then gone with error ( SERVER_ERROR: [code] 1675030 [message]: Error performing query. [extra]:)

It seems that you are using a real user to sign in with facebook, if your app is in develop mode you shoud use a test user or use the user who created the facebook app. https://stackoverflow.com/questions/41861564/server-error-code-1675030-message-error-performing-query

yeah i checked that, but its working fine with test users on LoginBehavior.webOnly, but on other dehaviors the dialog is disappearing after one second, what should i do now, i appreciate your help thank you very much.

The main problem is that if you are trying to login with a real user your app in the facebook developer console must be in production mode or the user that your are using must be the facebook app creator

shahid31346 commented 1 year ago

ok thank you

shahid31346 commented 1 year ago

Very helpful.

ankitRay1 commented 1 year ago

Try once to run cd android && ./gradlew clean OR cd android && gradlew clean in your flutter/android directory. AND THEN RUN YOUR FLUTTER PROJECT AGAIN. I have tried this and it fixed my issue quickly.