I get this error when I try running.
Launching lib/main.dart on iPhone XR in debug mode...
Starting Xcode build...
Xcode build done. 35.9s
*** First throw call stack:
(
0 CoreFoundation 0x00000001099ff1bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000108f9d735 objc_exception_throw + 48
2 CoreFoundation 0x00000001099ff015 +[NSException raise:format:] + 197
3 Runner 0x00000001040a8aa0 +[FIRApp configure] + 576
4 Runner 0x00000001044a931c -[FLTCloudFirestorePlugin init] + 188
5 Runner 0x00000001044a91c9 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
6 Runner 0x000000010404d19e +[GeneratedPluginRegistrant registerWithRegistry:] + 126
7 Runner <…>
[✓] Flutter (Channel dev, v1.1.5, on Mac OS X 10.14.2 18C54, locale en-NG)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.6)
[✓] Connected device (1 available)
• No issues found!
To test or deploy our flutter app to a physical device we first need to enable physical device deployment in Xcode using Apple ID or an Apple Developer account. And we also need to set up a package manager to manage flutter plugins that are to be used in the project.
It has gained popularity for its ability to create cross-platform apps. Flutter apps can be developed at one go and cross-compiled for different platforms – Mac, iOS, Android, Linux, Windows, Google Fuchsia, Linux, and the web.
Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS.
I guess you forgot to add GoogleService-Info.plist
file to your ios project
Follow this codelab (point 6 and 7 specifically) for detailed instruction.
Remember that it's not enough to copy it in your ios/Runner
folder from the finder/explorer
or command line
.
You need to open the ios/Runner.xcworkspace
with Xcode
and add the file to the project tree. Xcode needs to be aware of this file, so that it can be copied in the application bundle.
For cases with two google-services plist files you can add a new build phase to copy the file to the correct location on compilation.
environment="default"
# Regex to extract the scheme name from the Build Configuration
# We have named our Build Configurations as Debug-dev, Debug-prod etc.
# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.
# We are using the $CONFIGURATION variable available in the XCode build environment to extract
# the environment (or flavor)
# For eg.
# If CONFIGURATION="Debug-prod", then environment will get set to "prod".
if [[ $CONFIGURATION =~ -([^-]*)$ ]]; then
environment=${BASH_REMATCH[1]}
fi
echo $environment
# Name and path of the resource we're copying
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
GOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}
# Make sure GoogleService-Info.plist exists
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}"
if [ ! -f $GOOGLESERVICE_INFO_FILE ]
then
echo "No GoogleService-Info.plist found. Please ensure it's in the proper directory."
exit 1
fi
# Get a reference to the destination location for the GoogleService-Info.plist
# This is the default location where Firebase init code expects to find GoogleServices-Info.plist file
PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
echo "Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}"
# Copy over the prod GoogleService-Info.plist for Release builds
cp "${GOOGLESERVICE_INFO_FILE}" "${PLIST_DESTINATION}"
Try running the app and it should be good
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With