showPreferencesForExtension error SFErrorDomain Code=1 "(null)" after pod install

After I fill Podfile, run pod install and then open my project via xcworkspace file. I found out that showPreferencesForExtension throw error SFErrorDomain Code=1 "(null)" if I will open the same project via xcodeproj file this method will works without any errors. What could be wrong?

Accepted Reply

I had the same issue. I resolved it by:


  1. Clean build folder
  2. Close the project/workspace
  3. `pod deintegrate`
  4. `rm -rf my_project.xcworkspace`
  5. Create a new workspace *manually* and add my project
  6. In root of Podfile add `install! 'cocoapods', :integrate_targets => false`
  7. In each target add `current_target_definition.swift_version = '5.0'` # Works around a bug when using 'integrate_targets => false
  8. `pod install`
  9. Add Pods.xcproject to my workspace


The first time I ran my build after this the extension disappeared from settings, but another clean build fixed everything up.

Replies

What is a Podfile/what is pod install?


I'm not sure what to tell you exactly at this point without a little more information.


I can tell you that Code=1 is SFErrorNoExtensionFound, so it looks like the system can't find your extension.

I had the same issue. I resolved it by:


  1. Clean build folder
  2. Close the project/workspace
  3. `pod deintegrate`
  4. `rm -rf my_project.xcworkspace`
  5. Create a new workspace *manually* and add my project
  6. In root of Podfile add `install! 'cocoapods', :integrate_targets => false`
  7. In each target add `current_target_definition.swift_version = '5.0'` # Works around a bug when using 'integrate_targets => false
  8. `pod install`
  9. Add Pods.xcproject to my workspace


The first time I ran my build after this the extension disappeared from settings, but another clean build fixed everything up.

Thank you, very much, it works for me!) Great step by step instruction!

But still, I can't import libraries that I've installed through cocoapod. For example, I have installed Alamofire, followed your instruction. My extension works fine, but I can't import Alamofire, xcode build failed with error: No such module 'Alamofire'.