iosxcodeflutterbuildsdwebimage

Can't build on iOS - SDWebImage: ARC Semantic Issue


I have a Flutter project that works fine on Android, but I can't run it on iOS. The build always fails.

SDWebImage shows an Arc Semantic Issue.

/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m:31:40: No visible @interface for 'UIImage' declares the selector 'imageByPreparingForDisplay'

/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m:48:40: No visible @interface for 'UIImage' declares the selector 'imageByPreparingThumbnailOfSize:'

What I've tried already:

Cleaned everything

  1. deleted the DerivedData folder
  2. closed Xcode
  3. rm -rf Podfile.lock
  4. rm -rf pubspec.lock
  5. rm -rf Pods
  6. pod repo update
  7. pod cache clean --all
  8. pod deintegrate
  9. flutter clean
  10. flutter pub get
  11. pod setup
  12. pod install --repo-update

Changed the iOS version

Tried on Xcode 12 and Xcode 13

Tried to change the targeted pod with errors to public instead of project

Tried to build for the simulator, Archive or just build (command + b)

The Flutter version I'm using is 3.0.4

Edit: This is my Podfile

 platform :ios, '14.4'
  use_modular_headers!

>

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

    pod 'GeoFire', :git => 'https://github.com/heinzan/geofire-objc'

     pod 'Firebase', :modular_headers => true
     pod 'FirebaseCore', :modular_headers => true
     pod 'GoogleUtilities', :modular_headers => true
     $RNFirebaseAsStaticFramework = true


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|
    target.build_configurations.each do |config|
          config.build_settings['ARCHS[sdk=iphonesimulator*]'] =  `uname -m`
          
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.4'

    end
    flutter_additional_ios_build_settings(target)
  end
 end


  target 'OneSignalNotificationServiceExtension' do
    # Comment the next line if you don't want to use dynamic frameworks
    use_frameworks!
    pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'
  end
```

Solution

  • I ended up deleting the ios folder and recreating with flutter create .