Search code examples
iosxcodeflutterflutter-build

error: Build input file cannot be found: '/Users/GoogleService-Info.plist' (in target 'Runner' from project 'Runner')


I'm trying to take the iOS build of a Flutter project. No matter what I try it just gives me the following error:

error: Build input file cannot be found: '/Users/GoogleService-Info.plist' (in target 'Runner' from project 'Runner')

This is the set of commands I am trying to get the build with:

  • flutter pub get
  • flutter clean
  • flutter build ios (this gives the above error)

Here is my flutter doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.16.3-pre.67, on Mac OS X 10.15.3 19D76, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.43.2)
[!] Connected device

! Doctor found issues in 1 category.

The flutter build ios --verbose ends with following error:

Encountered error while building for the device.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1      BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:93:7)
<asynchronous suspension>
#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:722:18)
#3      _rootRunUnary (dart:async/zone.dart:1155:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1048:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:526:5)
#9      Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:556:7)
#10     _rootRun (dart:async/zone.dart:1147:13)
#11     _CustomZone.run (dart:async/zone.dart:1040:19)
#12     _CustomZone.runGuarded (dart:async/zone.dart:942:7)
#13     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:982:23)
#14     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#15     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#16     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

Here is the image of the folder structure. As you can see, there is no 'Users' folder that holds the Google plist. So, it is quite confusing why would the script try to copy the plist from a non-existing directory. Any advice to fix this would be highly appreciated. TIA :-)

enter image description here


Solution

  • Remove the GoogleService-Info.plist and then again add the file into the Runner directory using Xcode, then choose copy items if needed and add to target checkmark. I hope this will solve your problem.