roughike / flutter_facebook_login

A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
BSD 2-Clause "Simplified" License
404 stars 332 forks source link

Facebook login with shared_preferences package error #277

Open Mustafa-Elsir opened 4 years ago

Mustafa-Elsir commented 4 years ago

Hello: I am using shared_preferences lib from here and everything works fine until I have added flutter_facebook_login I always get this error and shared_preferences stopped working.

E/flutter (16302): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

when trying to run the app without shared_preferences I always got this error E/flutter (16302): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method logIn on channel com.roughike/flutter_facebook_login)

I tried flutter clean and still exists, try to delete every package in /flutter_sdk_path/.pub-cache/hosted/pub.dartlang.org/ and install them again but still exists and I even try to delete the flutter SDK itself and download it again and still same error.

madz commented 4 years ago

Fix this by completing the AndroidManifest.xml Make sure you have all the correct properties and configuration.

ly95 commented 4 years ago

same issues

mustafa-code commented 4 years ago

Fix this by completing the AndroidManifest.xml Make sure you have all the correct properties and configuration.

I already write the properties from the documentation and nothing happened

ananpengkhun commented 4 years ago

same issue

madz commented 4 years ago

Fix this by completing the AndroidManifest.xml Make sure you have all the correct properties and configuration.

I already write the properties from the documentation and nothing happened

Post your AndroidManifest.xml just remove your API keys

mustafa-code commented 4 years ago

Fix this by completing the AndroidManifest.xml Make sure you have all the correct properties and configuration.

I already write the properties from the documentation and nothing happened

Post your AndroidManifest.xml just remove your API keys

Here is my file

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

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="Afandim"
    android:hardwareAccelerated="true"
    android:icon="@mipmap/ic_launcher">

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="GOOGLE_MAPS_KEY"/>

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

        <meta-data
          android:name="io.flutter.embedding.android.NormalTheme"
          android:resource="@style/NormalTheme"
          />

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

    <meta-data android:name="com.facebook.sdk.ApplicationId"
        android:value="FACEBOOK_KEY"/>

    <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
            "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="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="FACEBOOK_SCHEME" />
        </intent-filter>
    </activity>

</application>

`

madz commented 4 years ago

Fix this by completing the AndroidManifest.xml Make sure you have all the correct properties and configuration.

I already write the properties from the documentation and nothing happened

Post your AndroidManifest.xml just remove your API keys

Here is my file

`

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="Afandim"
    android:hardwareAccelerated="true"
    android:icon="@mipmap/ic_launcher">

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="GOOGLE_MAPS_KEY"/>

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

        <meta-data
          android:name="io.flutter.embedding.android.NormalTheme"
          android:resource="@style/NormalTheme"
          />

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

    <meta-data android:name="com.facebook.sdk.ApplicationId"
        android:value="FACEBOOK_KEY"/>

    <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
            "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="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="FACEBOOK_SCHEME" />
        </intent-filter>
    </activity>

</application>

`

Seems good to me. Try this solution https://github.com/flutter/flutter/issues/38873#issuecomment-619355098

mustafa-code commented 4 years ago

Still not solved 😣

hillelcoren commented 4 years ago

I'm seeing the same error trying to run our app on Windows desktop

We're using shared_preferences but we aren't using flutter_facebook_login

sanekyy commented 4 years ago

same issue:(

MohammadUzair1 commented 4 years ago

https://programmingproalpha.blogspot.com/2020/08/how-to-make-facebook-log-in.html

Visit this site , it will help you alot in flutter facebook login

KlemenAndrasic commented 3 years ago

Any fix for this?