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.71k stars 3.97k forks source link

🐛 [firebase_auth] Can't run app on iPad (M1) after adding firebase_auth dependency #6497

Closed mvrsn closed 1 year ago

mvrsn commented 3 years ago

Bug report

I am working on an app that already has firebase_core and firebase_database set up and working nicely on every device that I've built to (iPhone, iPad, Android phone) and everything is running fine, but as soon as I add firebase_auth I can no longer build for the iPad (but builds fine on the other devices)

In the build output there are no errors to be found, so I have no idea where to even start looking to solve the problem

I have tried with everything that I can think of like changing the deployment target versions, adding the pods to the Podfile manually, running all sorts of cleanup steps like flutter clean but nothing seems to do the trick

Worth noticing is that I have another project that has been using Firebase Auth for months, and it also does not build on the iPad and results in the same error

The iPad is an M1 in case that might have something to do with it

Build output

Click to Expand ``` [ +235 ms] success [ ] Application launched on the device. Waiting for observatory port. [{"event":"app.progress","params":{"appId":"e64d798d-510b-426d-984b-eb17eb18a0d0","id":"2","progressId":null,"finished":true}}] [+30016 ms] Error launching application on iPad. [ +4 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:563:9) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1043:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:196:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) #8 run.. (package:flutter_tools/runner.dart:62:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 main (package:flutter_tools/executable.dart:91:3) [{"event":"app.stop","params":{"appId":"e64d798d-510b-426d-984b-eb17eb18a0d0"}}] [ +7 ms] "flutter run" took 105,434ms. [ +1 ms] (lldb) process detach [{"id":0,"error":"app 'e64d798d-510b-426d-984b-eb17eb18a0d0' not found","trace":"#0 AppDomain.stop (package:flutter_tools/src/commands/daemon.dart:709:7)\n#1 Domain.handleCommand. (package:flutter_tools/src/commands/daemon.dart:220:34)\n#2 new Future.sync (dart:async/future.dart:218:31)\n#3 Domain.handleCommand (package:flutter_tools/src/commands/daemon.dart:218:5)\n#4 Daemon._handleRequest (package:flutter_tools/src/commands/daemon.dart:144:28)\n#5 _rootRunUnary (dart:async/zone.dart:1362:47)\n#6 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#10 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#11 _MapStream._handleData (dart:async/stream_pipe.dart:218:10)\n#12 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#13 _rootRunUnary (dart:async/zone.dart:1362:47)\n#14 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#18 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#19 _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)\n#20 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#21 _rootRunUnary (dart:async/zone.dart:1362:47)\n#22 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#23 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#28 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#29 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)\n#30 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)\n#31 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)\n#32 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#33 _rootRunUnary (dart:async/zone.dart:1362:47)\n#34 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#35 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#37 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#38 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#39 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#40 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#41 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)\n#42 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)\n#43 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)\n#44 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)\n#45 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#46 _rootRunUnary (dart:async/zone.dart:1362:47)\n#47 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#48 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#49 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#50 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#51 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#52 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#53 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#54 _Socket._onData (dart:io-patch/socket_patch.dart:2160:41)\n#55 _rootRunUnary (dart:async/zone.dart:1370:13)\n#56 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#57 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#58 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#59 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#60 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#61 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#62 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#63 new _RawSocket. (dart:io-patch/socket_patch.dart:1696:33)\n#64 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1208:14)\n#65 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)\n#66 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)\n#67 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)\n#68 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)\n"}] ```

Flutter doctor

Click To Expand ``` [✓] Flutter (Channel stable, 2.2.2, on macOS 11.3.1 20E241 darwin-x64, locale en-GB) • Flutter version 2.2.2 at /Users/me/sdk/flutter2 • Framework revision d79295af24 (2 weeks ago), 2021-06-11 08:56:01 -0700 • Engine revision 91c9fc8fe0 • Dart version 2.13.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/me/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • Java binary at: /Users/me/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7094744/Android Studio 4.2 Preview.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5, Build version 12E262 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio • Android Studio at /Users/me/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7094744/Android Studio 4.2 Preview.app/Contents • 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.8+10-b944.6916264) [✓] VS Code (version 1.56.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.22.0 [✓] Connected device (2 available) • iPad (mobile) • 00000000-00160C542ADA001E • ios • iOS 14.5 • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114 • No issues found! ```

Flutter dependencies

Click To Expand ``` Dart SDK 2.13.3 Flutter SDK 2.2.2 curtain 1.0.0+1 dependencies: - firebase_auth 1.4.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.3.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_database 7.1.1 [firebase_core flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml] - google_fonts 2.1.0 [flutter http path_provider crypto] - provider 5.0.0 [collection flutter nested] - shared_preferences 2.0.6 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] dev dependencies: - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] transitive dependencies: - async 2.6.1 [meta collection] - boolean_selector 2.1.0 [source_span string_scanner] - characters 1.1.0 - charcode 1.2.0 - clock 1.1.0 - collection 1.15.0 - crypto 3.0.1 [collection typed_data] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase_auth_platform_interface 4.3.1 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 1.3.1 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - http 0.13.3 [async http_parser meta path pedantic] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - intl 0.17.0 [clock path] - js 0.6.3 - matcher 0.12.10 [stack_trace] - meta 1.3.0 - nested 1.0.0 [flutter] - path 1.8.0 - path_drawing 0.5.1 [vector_math meta path_parsing flutter] - path_parsing 0.2.1 [vector_math meta] - path_provider 2.0.2 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 2.0.0 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.11.1 - petitparser 4.1.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.0 [meta] - process 4.2.1 [file path platform] - shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows] - sky_engine 0.0.99 - source_span 1.8.1 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - string_scanner 1.1.0 [charcode source_span] - term_glyph 1.2.0 - test_api 0.3.0 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.0 [collection] - vector_math 2.1.0 - win32 2.2.1 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.2 [collection meta petitparser] ```

darshankawar commented 3 years ago

@mvrsn Can you provide the entire log by running flutter run --verbose ?

If you remove firebase_auth and run, do you see anything after:

[ +235 ms] success
[        ] Application launched on the device. Waiting for observatory port.
[{"event":"app.progress","params":{"appId":"e64d798d-510b-426d-984b-eb17eb18a0d0","id":"2","progressId":null,"finished":true}}]

I am just wondering if using the auth plugin, it's somehow getting stuck at Waiting for observatory port. and not getting the available port and if it works without that plugin.

mvrsn commented 3 years ago

@darshankawar This is the full output after success running with --verbose

[ +213 ms] success
[        ] Application launched on the device. Waiting for observatory port.
[+30018 ms] Installing and launching... (completed in 48.8s)
[   +1 ms] Error launching application on iPad.
[   +8 ms] "flutter run" took 102,449ms.
[   +6 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>

[   +3 ms] (lldb) process detach
[ +159 ms] ensureAnalyticsSent: 161ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

One interesting detail that I just noticed is that the app actually builds successfully when I build directly through XCode.

Just speculating now, but could it maybe have something to do with XCode being better at building for the correct architecture than the command-line tool? 🤔

Edit: I also just tried building the app on a non-M1 iPad through Android Studio with success

darshankawar commented 3 years ago

Although I don't have M1, but I tried to replicate on Catalina macOS on which my sample app compiled, built and launched successfully as below after adding auth and other firebase plugins:

dependencies:
  flutter:
    sdk: flutter
  flushbar: ^1.10.4
  cloud_firestore: ^2.2.2
  firebase_analytics: ^8.1.2
  firebase_core: ^1.3.0
  firebase_auth: ^1.4.1
Screenshot 2021-06-30 at 3 36 56 PM

Worked both, from AS and Xcode properly.

flutter doctor -v ``` [✓] Flutter (Channel stable, 2.2.2, on Mac OS X 10.15.4 19E2269 darwin-x64, locale en-GB) • Flutter version 2.2.2 at /Users/dhs/documents/fluttersdk/flutter • Framework revision d79295af24 (11 days ago), 2021-06-11 08:56:01 -0700 • Engine revision 91c9fc8fe0 • Dart version 2.13.3 [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.56.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (4 available) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.106 • No issues found! ```

Keeping it open for further insights from team.

russellwheatley commented 3 years ago

Hey @mvrsn, I've just built an app with firebase_auth package for iPad 6th & 8th generation simulators. Presumably your build is failing on an actual iPad device?

mvrsn commented 3 years ago

@russellwheatley yea that is correct, I didn't try on a simulator yet but will try tomorrow if I find the time

mvrsn commented 3 years ago

So I just tried building the app for the 8th generation iPad simulator with success with firebase_auth: 1.4.1, but it still does not build for the actual device

I also saw that version 2.0.0 of firebase_auth was just released so I tried again to build for both the simulator and device, and the outcome is the same as with version 1.4.1 with nothing relevant in the console event when building with --verbose

mvrsn commented 3 years ago

@markusaksli-nc how come the Needs Attention label was removed? Just asking as I want to avoid this issue being closed due to inactivity

markusaksli-nc commented 3 years ago

That's just to remove the issue from the new issues filter. Once an issue has a specific plugin label it is ready to be investigated/worked on.

russellwheatley commented 2 years ago

Hey @mvrsn, is this still an issue?

google-oss-bot commented 1 year ago

Hey @mvrsn. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@mvrsn if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.