firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.64k stars 3.96k forks source link

Registration with email and log in. #2786

Closed besidesordinary closed 4 years ago

besidesordinary commented 4 years ago

When I create an email account on an Android device, i am not able to use that same account for a future log in with an iOS device, and vice versa.

iapicca commented 4 years ago

Hi @besidesordinary Can you please provide your flutter doctor -v, your flutter run --verbose while attempting to register with email, your pubspec.yaml and a minimal reproducible code sample. Thank you

besidesordinary commented 4 years ago

Hi @iapicca This is what I get when i try to sign in from an iOS simulator, with account that has been created on an Android simulator (i would also like to mention that i also tried and tested with real devices)

Syncing files to device iPhone SE (2nd generation)...
Reloaded 0 of 737 libraries in 401ms.
flutter: PlatformException(ERROR_WRONG_PASSWORD, The password is invalid or the user does not have a password., null)

Here is flutter doctor -v

flutter doctor -v ``` ivan@Ivans-Air-3 pss_app % flutter doctor -v [✓] Flutter (Channel dev, 1.19.0-5.0.pre, on Mac OS X 10.15.5 19F101, locale en-MK) • Flutter version 1.19.0-5.0.pre at /Users/ivan/Documents/development/flutter • Framework revision c264b70ec3 (11 days ago), 2020-06-08 09:27:34 -0700 • Engine revision c7f9725521 • Dart version 2.9.0 (build 2.9.0-13.0.dev 87c5e3612b) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /Users/ivan/Library/Android/sdk • Platform android-29, build-tools 29.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.9.1 [✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 46.0.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] Connected device (1 available) • iPhone SE (2nd generation) • 7DC3E83F-BA2E-4C4F-BBD9-E7ACA75110DE • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator) • No issues found! ```

And flutter run --verbose

flutter run --verbose ``` [+2348 ms] executing: /usr/bin/xcrun simctl install 7DC3E83F-BA2E-4C4F-BBD9-E7ACA75110DE /Users/ivan/Documents/development/pss_app/build/ios/iphonesimulator/Runner.app [+3075 ms] executing: /usr/bin/plutil -convert json -o - /Users/ivan/Documents/development/pss_app/build/ios/iphonesimulator/Runner.app/Info.plist [ +40 ms] Exit code 0 from: /usr/bin/plutil -convert json -o - /Users/ivan/Documents/development/pss_app/build/ios/iphonesimulator/Runner.app/Info.plist [ +2 ms] {"DTCompiler":"com.apple.compilers.llvm.clang.1_0","CFBundleInfoDictionaryVersion":"6.0","UISupportedInterfaceOrientations~ipad":["UIInterfaceOrien tationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],"DTPlatfor mVersion":"13.5","CFBundleName":"nexthop.pss","DTSDKName":"iphonesimulator13.5","UIViewControllerBasedStatusBarAppearance":false,"CFBundleIcons":{" CFBundlePrimaryIcon":{"CFBundleIconFiles":["AppIcon60x60"],"CFBundleIconName":"AppIcon"}},"NSLocationAlwaysAndWhenInUseUsageDescription":"This app needs access to location when open and in the background.","LSRequiresIPhoneOS":true,"LSApplicationQueriesSchemes":["fbapi","fbapi20130214","fbapi20130410","fbapi20130702","fbapi20131010","fbap i20131219","fbapi20140410","fbapi20140116","fbapi20150313","fbapi20150629","fbapi20160328","fbauth","fb-messenger-share-api","fbauth2","fbshareexte nsion"],"NSLocationWhenInUseUsageDescription":"This app needs access to location when open.","DTSDKBuild":"17F65","CFBundleShortVersionString":"1.0.0","CFBundleSupportedPlatforms":["iPhoneSimulator"],"NSLocationAlwaysUsageDescription ":"This app needs access to location when in the background.","UISupportedInterfaceOrientations":["UIInterfaceOrientationPortrait","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLand scapeRight"],"BuildMachineOSBuild":"19F101","DTPlatformBuild":"17F65","CFBundlePackageType":"APPL","DTXcodeBuild":"11E608c","CFBundleDevelopmentReg ion":"en","MinimumOSVersion":"12.0","CFBundleVersion":"1","FacebookAppID":"2894734743946732","UIDeviceFamily":[1,2],"UILaunchStoryboardName":"Launc hScreen","CFBundleIdentifier":"nexthop.pss","FacebookDisplayName":"PSS","DTXcode":"1150","CFBundleExecutable":"Runner","CFBundleIcons~ipad":{"CFBun dlePrimaryIcon":{"CFBundleIconFiles":["AppIcon60x60","AppIcon76x76"],"CFBundleIconName":"AppIcon"}},"CFBundleSignature":"????","UIMainStoryboardFil e":"Main","DTPlatformName":"iphonesimulator","CFBundleURLTypes":[{"CFBundleTypeRole":"Editor","CFBundleURLSchemes":["fb2894734743946732","com.googl eusercontent.apps.20198450506-afk5tdijp3joo8ouqrd1d1doct3di0pe"]}]} [ +18 ms] executing: /usr/bin/xcrun simctl launch 7DC3E83F-BA2E-4C4F-BBD9-E7ACA75110DE nexthop.pss --enable-dart-profiling --enable-checked-mode --verify-entry-points --observatory-port=0 [+1274 ms] nexthop.pss: 6167 [ +1 ms] Waiting for observatory port to be available... [+1733 ms] [Firebase/Crashlytics] Version 4.0.0-beta.7 [ +71 ms] [Crashlytics] Version 3.14.0 (144) [ +9 ms] [Fabric] [Fabric +with] called multiple times. Only the first call is honored, please pass all kits you wish to initialize [ +408 ms] Observatory URL on device: http://127.0.0.1:53443/ExhwD9EDcUE=/ [ +20 ms] Caching compiled dill [ +114 ms] Connecting to service protocol: http://127.0.0.1:53443/ExhwD9EDcUE=/ [ +128 ms] [Fabric] failed to download settings Error Domain=FABNetworkError Code=-5 "(null)" UserInfo={status_code=403, type=2, request_id=, content_type=application/json; charset=utf-8} [ +457 ms] Successfully connected to service protocol: http://127.0.0.1:53443/ExhwD9EDcUE=/ [ ] Waiting for iPhone SE (2nd generation) to report its views... [ +9 ms] Waiting for iPhone SE (2nd generation) to report its views... (completed in 9ms) [ +20 ms] DevFS: Creating new filesystem on the device (null) [ +28 ms] DevFS: Created new filesystem on the device (file:///Users/ivan/Library/Developer/CoreSimulator/Devices/7DC3E83F-BA2E-4C4F-BBD9-E7ACA75110DE/data/Containers/Data/Application/6D318E8E-6173-4D1 A-93A3-9FB20637D197/tmp/pss_appg5p8RQ/pss_app/) [ +7 ms] Updating assets [+1168 ms] Syncing files to device iPhone SE (2nd generation)... [ +4 ms] Scanning asset files [ +18 ms] <- reset [ ] Compiling dart to kernel with 0 updated files [ +6 ms] <- recompile package:pss_app/main.dart 8dd5c73e-cf0d-4c08-8214-5629dfbb55af [ +1 ms] <- 8dd5c73e-cf0d-4c08-8214-5629dfbb55af [ +2 ms] [Crashlytics:Crash] Warning: NSUncaughtExceptionHandler is 'FBSDKExceptionHandler' in '/Users/ivan/Library/Developer/CoreSimulator/Devices/7DC3E83F-BA2E-4C4F-BBD9-E7ACA75110DE/data/Containers/Bundle/Application/3832A469-978B-4E7A-ACF D-DB242B7947D4/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' [ +160 ms] Updating files [ +772 ms] DevFS: Sync finished [ ] Syncing files to device iPhone SE (2nd generation)... (completed in 965ms) [ +1 ms] Synced 3.5MB. [ +2 ms] <- accept [ +3 ms] Connected to _flutterView/0x7fca6c01b620. [ +6 ms] Flutter run key commands. [ +7 ms] r Hot reload. 🔥🔥🔥 [ +2 ms] R Hot restart. [ +1 ms] h Repeat this help message. [ +1 ms] d Detach (terminate "flutter run" but leave application running). [ +1 ms] c Clear the screen [ ] q Quit (terminate the application on the device). [ ] An Observatory debugger and profiler on iPhone SE (2nd generation) is available at: http://127.0.0.1:53443/ExhwD9EDcUE=/ [+648742 ms] flutter: PlatformException(ERROR_WRONG_PASSWORD, The password is invalid or the user does not have a password., null) ```
code sample ```dart final AuthService _auth = AuthService(); final _formKey1 = GlobalKey(); final _formKey2 = GlobalKey(); String email = ''; String password = ''; String error = ''; bool loading = false; bool _ObscureText = true; RaisedButton( elevation: 0.0, onPressed: () async { if ( (_formKey1.currentState.validate()) && (_formKey2.currentState.validate()) ){ setState(() => loading = true); dynamic result = await _auth.signInWithEmailAndPassword(email, password); if (result == null) { _auth.signOut(); setState(() { loading = false; error = '\nWrong email or password'; }); } if(loading == true) { Navigator.pushReplacement( context, MaterialPageRoute(builder: (context) => Wrapper()), ); } } }, padding: EdgeInsets.all(15.0), color: Colors.white, child: SizedBox( width: 500, child: Text( 'Enter', style: TextStyle( color: Colors.red[400], letterSpacing: 1.5, fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'OpenSans', ), textAlign: TextAlign.center, ), ), ), Text( error, style: TextStyle(color: Colors.black, fontSize: 14.0), textAlign: TextAlign.center, ) ```
pubspec.yaml ```yaml cupertino_icons: ^0.1.2 firebase_core: ^0.4.4+3 firebase_analytics: ^5.0.11 firebase_auth: ^0.16.0 google_sign_in: ^4.4.4 flutter_facebook_login: ^3.0.0 flutter_auth_buttons: ^0.8.0 firebase_database: ^3.1.5 provider: ^4.0.5+1 http: ^0.12.1 flutter_spinkit: ^4.1.2+1 firebase_crashlytics: ^0.1.3+3 slider_button: ^0.5.0 table_calendar: ^2.2.3 location: ^3.0.2 geolocator: ^5.3.1 fluttertoast: ^4.0.1 intl: ^0.16.1 device_info: any shared_preferences: ^0.5.7 http_interceptor: any flutter_picker: ^1.1.5 flutter_datetime_picker: ^1.3.8 package_info: ^0.4.1 ```

Thank you!

Best regards besidesordinary

iapicca commented 4 years ago

Hi @besidesordinary the issue might be caused by your implementation rather than a bug in flutterfire plugins you may want to look at this possible solution

Closing, as this isn't an issue with FlutterFire itself. If you disagree, please write in the comments and I will reopen it. Thank you