3

When I build the app using VScode or the terminal or XCode it runs perfectly without adding the dependency but when I add the dependency to my Pubspec.yaml I get the Following Error:


/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTUploadOperation.m:36:9: fatal error: 'GoogleUtilities/GULURLSessionDataResponse.h' file not found #import <GoogleUtilities/GULURLSessionDataResponse.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description Could not build the application for the simulator. Error launching application on iPhone 11. Exited (sigterm)** 

**

I Tried Searching here for Solutions couldn't find Any. Previous Solutions I tried were:

  1. Running Flutter Clean Then Flutter Run (Didn't Work)
  2. Deleting the Podfile.lock and podfile and .xcworkspace file and Then running pod install in the terminal(didn't work)
  3. Pod update

here is my flutter doctor Trace:

**[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2 20D64 darwin-x64, locale en-EG) [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [!] Android Studio (not installed) [✓] Connected device (2 available)** 

and here is my PodFile:

 # Uncomment this line to define a global platform for your project # platform :ios, '9.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end 

And here is my pubspec.yaml, Yes I'm using an older version of firebase cloud messaging and it's due to dependency conflict between firebase Core and the new Firebase cloud messaging version "^9.0.0"

 version: 1.0.0+1 environment: sdk: ">=2.7.0 <3.0.0" dependencies: flutter: sdk: flutter firebase_core: "0.7.0" firebase_auth: ^0.20.0+1 flutter_spinkit: "^4.1.2" google_sign_in: ^4.5.3 connectivity: ^2.0.2 path: any sqflite: ^1.3.2+3 share: ^0.6.5+4 flutter_facebook_login: ^3.0.0 apple_sign_in: ^0.1.0 provider: ^4.0.1 crypto: ^2.1.5 in_app_purchase: ^0.5.1 flutter_email_sender: ^5.0.0 scroll_snap_list: ^0.6.0 firebase_messaging: ^5.1.2 flutter_twitter_login: git: https://github.com/Kiruel/flutter_twitter_login cupertino_icons: ^1.0.0 dev_dependencies: flutter_test: sdk: flutter 
2
  • I am getting the same issue though all things are ok according to my flutter doctor i.e. Android SDK is installed ok Commented Mar 24, 2021 at 12:49
  • firebase.google.com/docs/ios/setup suggests that your project must target iOS 10 or later so I changed platform :ios, '12.0' but that didn't help either. Commented Mar 24, 2021 at 12:56

3 Answers 3

1

I have finally figured out the solution. And the solution is to not follow the guidelines on firebase.google.com while creating iOS App in firebase. You should strictly follow the guidelines on https://firebase.flutter.dev/docs/overview/

To recap the steps I took:

  1. Created a new flutter project
  2. In pubspec.yaml added firebase_core: "0.7.0" under dependencies. Did pub get
  3. Browsed to project directory > iOS folder > open projectname.xcworkspace
  4. Click on Runner and in General copy Bundle Identifier.
  5. Change iOS version to 10 or later in Development Info in the General Tab
  6. Paste this Bundle Identifier in "Add Firebase to your iOS app" Step 1 Register
  7. Click Next and download the GoogleService-Info.plist
  8. In projectname.xcworkspace click on Runner at the TOP. Right Click and press "Add files to Runner". Browse the GoogleService-Info.plist file. Ensure the "Copy items if needed" checkbox is enabled
  9. Once done run the project without taking any further steps and it should work fine.

I just created two new projects to ensure it is working before posting here and it works fine. I hope it works for you too.

Sign up to request clarification or add additional context in comments.

1 Comment

That wasn't the solution for me but i hope it helps some one
0

The error report is saying If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.`

Have you tried there?

1 Comment

I dont need an android SDK i'm launching the app on ios it wasn't the problem. Thanks anyway
0

The Problem was with the Firebase cloud messaging package apparently, The only Solution that worked for me was to upgrade all the firebase packages.

Open Pub.dev and for search for every firebase dependency you have and update the version you will use ad then after updating all the version run flutter pub get in your terminal or just save your pubspec.yaml file and it will auto run pub get . The newest package doesn't induce this bug.(Version 9.0.0).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.