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
- deleted the DerivedData folder
- closed Xcode
- rm -rf Podfile.lock
- rm -rf pubspec.lock
- rm -rf Pods
- pod repo update
- pod cache clean –all
- pod deintegrate
- flutter clean
- flutter pub get
- pod setup
- pod install –repo-update
Changed the iOS version
- I can’t go lower than iOS 13.0 because of some dependencies
- Tried iOS 13, iOS 14, iOS 14.4, iOS 14.5
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
```
2
Answers
I ended up deleting the ios folder and recreating with flutter create .
Try adding use framework in podfile like
You must already have Target runner do. Just as use frameworks