Thursday, February 29, 2024
HomeiOS Developmentios - Flutter Lexical or Preprocessor Concern (Xcode): 'GoogleMobileAds/GoogleMobileAds.h' file not discovered

ios – Flutter Lexical or Preprocessor Concern (Xcode): ‘GoogleMobileAds/GoogleMobileAds.h’ file not discovered


After I up to date flutter to the newest model I maintain getting this error for GoogleMobileAds and GoogleMaps

When I attempt to flutter construct ios I get the identical error
Lexical or Preprocessor Concern (Xcode): 'GoogleMaps/GoogleMaps.h' file not discovered /Customers/.../.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.3.1/ios/Lessons/GoogleMa pPolylineController.h:5:8

Lexical or Preprocessor Concern (Xcode): 'GoogleMobileAds/GoogleMobileAds.h' file not discovered /Customers/.../.pub-cache/hosted/pub.dev/google_mobile_ads-4.0.0/ios/Clas ses/NativeTemplates/GoogleAdsMobileIosNativeTemplates/GADTTemplateView.h:14: 8

(Relying which package deal is discovered within the pubspec)

System

  • macOS: 13.5.1
  • xCode: 15.2
  • Flutter model 3.19.1
  • Dart model 3.3.0
  • CocoaPods model 1.15.1
[✓] Flutter (Channel secure, 3.19.1, on macOS 13.5.1 22G90 darwin-arm64,
    locale en-GR)
[✓] Android toolchain - develop for Android units (Android SDK model
    34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the online
[✓] Android Studio (model 2022.3)
[✓] VS Code (model 1.86.2)
[✓] Linked system (2 out there)
[✓] Community sources

Within the undertaking I first encountered this difficulty has quite a lot of packages however at first I used to be utilizing
google_mobile_ads: ^2.3.0

Many urged to attempt on a brand new undertaking however no luck there I get the identical difficulty, I additionally tried one of many examples from the google advertisements repo and I get the identical difficulty…
I even tried from Codemagic to construct my app and once more I get the identical difficulty…

I’ve additionally tried:

  • enjoying with decrease variations of the two packages
  • rm -rf Pods Podfile.lock
  • pod cache clear --all together with flutter pub cache clear
  • Add the two packages within the Podfile
  • deintegrate pods and set up/replace

I’ve been looking for an answer for over 2 weeks now that is changing into extraordinarily irritating, please assist me out on this. Beneath is my podfile and the dependencies of my pubspec.

Podfile

# Uncomment this line to outline a worldwide platform in your undertaking
platform :ios, '14.0'

# CocoaPods analytics sends community stats synchronously affecting flutter construct latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

undertaking 'Runner', {
  'Debug' => :debug,
  'Profile' => :launch,
  'Launch' => :launch,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.be a part of('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  until File.exist?(generated_xcode_build_settings_path)
    increase "#{generated_xcode_build_settings_path} should exist. In case you're working pod set up manually, be certain that flutter pub get is executed first"
  finish

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT=(.*)/)
    return matches[1].strip if matches
  finish
  increase "FLUTTER_ROOT not present in #{generated_xcode_build_settings_path}. Attempt deleting Generated.xcconfig, then run flutter pub get"
finish

require File.expand_path(File.be a part of('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

goal 'Runner' do
  pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
  pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'

  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
finish

post_install do |installer|
  # Guarantee pods additionally use the minimal deployment goal set above
  # https://stackoverflow.com/a/64385584/436422
  places 'Figuring out pod undertaking minimal deployment goal'

  pods_project = installer.pods_project
  deployment_target_key = 'IPHONEOS_DEPLOYMENT_TARGET'
  deployment_targets = pods_project.build_configurations.map config.build_settings[deployment_target_key] 
  minimum_deployment_target = deployment_targets.min_bymodel

  places 'Minimal deployment goal is ' + minimum_deployment_target
  places 'Setting every pod deployment goal to ' + minimum_deployment_target

  installer.pods_project.targets.every do |goal|
    flutter_additional_ios_build_settings(goal)
    goal.build_configurations.every do |config|
      #config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings[deployment_target_key] = minimum_deployment_target
    finish
  finish
finish

Dependencies from pubspec.yaml

I left another google packages simply in case which may should do something with my downside as a result of I face the identical difficulty with google maps

atmosphere:
  sdk: '>=2.18.4 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  flutter_riverpod:

  cupertino_icons: ^1.0.2
  firebase_core: ^2.7.1
  firebase_auth: ^4.6.3
  cloud_firestore: ^4.8.2
  firebase_messaging: ^14.2.6
  firebase_analytics: ^10.1.5
  firebase_crashlytics: ^3.0.16
  connectivity_plus: ^3.0.3
  intl: any
  google_fonts: ^4.0.3
  firebase_storage: ^11.0.16
  google_sign_in: ^6.1.5
  bloc: ^8.1.1
  equatable: ^2.0.5
  flutter_bloc: ^8.1.2
  ...
  google_maps_flutter: ^2.5.3
  geolocator: ^9.0.2
  geocoding: ^2.1.0
  firebase_ui_firestore: ^1.5.6
  google_mobile_ads: 4.0.0

flutter_launcher_icons:
...


dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.0
  mockito: ^5.4.2
  build_runner: ^2.4.6



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments