简体   繁体   中英

Flutter Xcode Build Failure: no visible @interface for 'UIImage' declares the selector 'imageByPreparingForDisplay'

ARC Semantic Issue: no visible @interface for 'UIImage' declares the selector 'imageByPreparingForDisplay'

So I have been going through the difficult task of getting my client's Flutter app over to IOS and built. I have been documenting a long thread here: What is a podfile target, and how to I specify Flutter modules for IOS version? after I was having a ton of difficulty getting all of my packages imported and the pods working.

Well I got those imported, and any pod warning fixed, but now the fatal error is coming from a pod package itself. This snippet is taken right from the error log:

/Users/prime/Desktop/ticket_board-master/ticket_board-master/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m:31:40: error: no visible @interface for 'UIImage' declares the selector 'imageByPreparingForDisplay'
        UIImage *decodedImage = [image imageByPreparingForDisplay];

Note that this app builds for Android, so I don't think its an issue with my existing code, but rather the package itself? Maybe I need to change something between IOS and Android? I tried just googling the error and searching here with no luck. I found another thread here: Can't build on iOS - SDWebImage: ARC Semantic Issue That seems to be the same issue as mine, and nobody has answered it, aside from the last ditch effort of completely deleting and recreating the entire IOS folder. Which I tried and doesn't work for me.

I also saw this thread here, which suggested going down a version, but also didn't work: https://bytemeta.vip/repo/miguelpruivo/flutter_file_picker/issues/1064

I've actually seen several threads on this that go left unanswered. I'll keep this updated if I find anything, but its not looking good.

This solution works here: https://bytemeta.vip/repo/miguelpruivo/flutter_file_picker/issues/1064

However it is just a temporary fix until the newest version is properly fixed.

target 'Runner' do
  use_frameworks!
  use_modular_headers!

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

  pod 'SDWebImage', '5.12.6'
end

This HAS to go in the podfile. You can't change the pod package version anywhere else. It won't work. You then have to run pod update in your ios sub directory to install the older version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM