Getting "No such module" error after running POD LIB LINT - swift

I'm trying to create a POD but when I run pod lib lint or pod spec lint, I get the next output:
`XXXXXX/LoginService/LoginService.swift:10:8: error: no such module
'TwitterKit' import TwitterKit
^
** BUILD FAILED **
The following build commands failed: CompileSwift normal x86_64
XXXXXX/LoginService/LoginService.swift CompileSwiftSources normal
x86_64 com.apple.xcode.tools.swift.compiler (2 failures) ->
LoginService (0.1.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- ERROR | [iOS] xcodebuild: /Users/danielfernandez/Documents/tekton_projects/LoginService/LoginService/LoginService.swift:10:8:
error: no such module 'TwitterKit'`
I don't know why, because If I build my project there is no errors, I'm using the TwitterKit without any problem.
This is my first time trying to create a pod. I used cocoapods to install Twitter Kit and my Xcode Version is 8.3.3
This is my POD SPEC:
If I put the s.dependency, I get this error: The 'Pods-App' target has transitive dependencies that include static binaries
If I use --use-libraries I get this error: Pods written in Swift can only be integrated as frameworks; add use_frameworks!
This is my Podfile:

Related

flutter No such module 'FBSDKCoreKit' error

I am a beginner at app development.
I am making an app with flutter, and the following error occurred while building with ios.
Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code
Swift Compiler Error (Xcode): No such module 'FBSDKCoreKit'
/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7
2
Could not build the application for the simulator.
Error launching application on iPhone 12.
Exited (sigterm)
But I never installed the facebook_auth package.
There is no flutter_facebook_auth in my pubspec.yaml file either.
But I keep getting the above error. Is there any solution?
Thank you for reading.
===============================================================
I did
flutter clean -> flutter pub get -> cd ios -> pod install -> run
And following is the result
/Users/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_compress-1.1.0/ios/Classes/CompressFileHandler.m:109:16: warning: unused variable 'swf' [-Wunused-variable]
const char swf[3] = {'F', 'W', 'S'};
^
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_compress-1.1.0/ios/Classes/CompressFileHandler.m:110:16: warning: unused variable 'swc' [-Wunused-variable]
const char swc[3] = {'C', 'W', 'S'};
^
4 warnings generated.
warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64 ios-arm64_x86_64-simulator ios-arm64_x86_64-maccatalyst' for the current build architectures (arm64 x86_64 i386).
Command CompileSwift failed with a nonzero exit code
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
import FBSDKCoreKit
^
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
import FBSDKCoreKit
^
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
import FBSDKCoreKit
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users//Downloads/GoogleService-Info.plist (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/ly/7jxqf41945g08nj820kfkblr0000gn/T/flutter_tools.QgWT3r/flutter_ios_build_temp_diruHeVSi/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code
Swift Compiler Error (Xcode): No such module 'FBSDKCoreKit'
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7
2
Could not build the application for the simulator.
Error launching application on iPhone 12.
Pod install result is fine.
This is the part of the pod install result
=================================================
pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7 File contents:
facebookauth.swift file contents
===============================================
I found following-facebook auth related- messages when i run the app on real android device
error msg when running on android device
I resolve this error by doing
remove Podfile.lock and Pods
update Podfile with platform :ios, '12.0' and config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
pod install
I also set the iOS deployment target to be 12.0 in the PROJECT.
https://github.com/darwin-morocho/flutter-facebook-auth/issues/299
I modified my Podfile
platform :ios, '11.0'
and config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' (in my case, both version were not same. 11.0 <-> 9.0)
and the error changed like below:
FIRStorageTypedefs.h:29:19: note: declaration here is not visible
typedef NSString *FIRStorageHandle NS_SWIFT_NAME(StorageHandle);
So I did pod uninstall, update, install, update, install..... T___T
arch -x86_64 pod update
arch -x86_64 pod install
and change the version of these like this
firebase_auth: 4.1.0
firebase_core: 2.1.1
cloud_firestore: 4.0.3
firebase_storage: 11.0.3
firebase_messaging: 14.0.3
cloud_functions: 4.0.3
firebase_remote_config: 3.0.3
Addition:
my command line tools of Xcode are already installed
$xcode-select --install
error: command line tools are already installed
install ffi.. all failed
sudo arch -x86_64 gem install ffi
sudo arch -arm64 gem pristine ffi
Thanks to everyone
I had the same problem,
in the podfile was:
platform :ios, '13.0
...
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
in config.build_settings I changed the version from 9.0 to 13.0
and it helped

pod spec lint command fails due to project-Swift.h

I am building an objective C framework with some swift files in it, and I want to create a pod. When I am using command pod spec link I get an error that says
ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
and I noticed that the is is a NOTE logged that says
fatal error: 'project/project-Swift.h' file not found
Xcoce builds normally the project but as I understand the xcodebuild command that runs through pod spec lint can not find the auto generated header.
Any thoughts? Do the other warnings of the code make xcodebuild to fail compilation and so the auto generated header is not getting created?

'React/RCTBridgeModule.h' file not found #import <React/RCTBridgeModule.h>

When I am trying to make XCFramework from the famous command line, I am facing the below error:
#import "Headers/private_framework.h"
^
../private_framework.h:9:9: error: 'React/RCTBridgeModule.h' file not found
#import <React/RCTBridgeModule.h>
<unknown>:0: error: could not build Objective-C module 'private_framework'
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
My private framework project has react-native dependencies. I am on Xcode 12.4. I have already tried the below steps:
Deleted derived data and clean build.
Deintegrated pods and did pod install.
Using the latest cocoa pod version.
sudo Xcode-select --reset.

Swift compiling error: Module map file not found + Missing required module 'SwiftShims'

I keep getting these errors after mistakenly running pod update.
Spent the last couple of days searching for solution but nothing helped, some of my attemtps:
1) How to fix cocoapod .modulemap file not found
2) missing required module 'SwiftShims' error generated by Xcode in project
Tried all the mentioned solutions in these Q's and some other SO Q's and nothing helped.
Error:
<unknown>:0: error: module map file '/Users/admin/Library/Developer/Xcode/DerivedData/Demo-
dkfcfedygluokngempogitocknga/Build/Products/Debug-iphonesimulator/Charts/Charts.modulemap' not found
<unknown>:0: error: module map file '/Users/admin/Library/Developer/Xcode/DerivedData/Demo-
dkfcfedygluokngempogitocknga/Build/Products/Debug-iphonesimulator/Charts/Charts.modulemap' not found
<unknown>:0: error: missing required module 'SwiftShims'
This is my Podfile:
target "Demo" do
pod 'Firebase/Core'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'Charts', '3.2.0'
end
I'm running MacOS 10.13.6 with Xcode 10.1, Cocoa pods version is 1.7.1
I had the error while trying to compile from the .xcodeproj instead of the .xcworkspace
(Building a React Native with Okta)

xcodebuild: Returned an unsuccessful exit code while building my own cocoapod

I'm practicing building my own pod.
I tagged my pod, added a podspec file and followed all steps, but the podspec validation still fails.
I have the following error : [iOS] xcodebuild: Returned an unsuccessful exit code
Here is my podspec file content after typing the command pod spec lint :
Pod::Spec.new do |spec|
spec.name = "RandomGenerator"
spec.version = "2.0.0"
spec.summary = "RandomGenerator cocoapod"
spec.license = 'MIT'
spec.platform = :ios, "11.0"
spec.swift_versions = "5.0"
spec.framework = "Foundation"
spec.source = { :git => "MY GIT SOURCE", :tag =>
spec.version }
spec.source_files = "RandomGenerator/**/*"
end
And here is the result of the command pod spec lint --verbose
RandomGenerator (2.0.0) - Analyzing on iOS 12.0 platform.
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-App`: (``)
Fetching external sources
-> Fetching podspec for `RandomGenerator` from `/Users/elitia/Desktop/Elitia/Hacker/swift/RandomGenerator/RandomGenerator/RandomGenerator.podspec`
Resolving dependencies of
Comparing resolved specification to the sandbox manifest
A RandomGenerator
Downloading dependencies
-> Installing RandomGenerator (2.0.0)
> Copying RandomGenerator from `/Users/elitia/Library/Caches/CocoaPods/Pods/External/RandomGenerator/24fbdd7e610122190d368443f1e96b67-ef799` to
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator`
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Installing files into Pods project
- Adding source files
- Adding frameworks
- Adding libraries
- Adding resources
- Linking headers
- Installing Pod Targets
- Installing target `RandomGenerator` iOS 12.0
- Generating module map file at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/RandomGenerator/RandomGenerator.modulemap`
- Generating umbrella header at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/RandomGenerator/RandomGenerator-umbrella.h`
- Generating Info.plist file at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/RandomGenerator/RandomGenerator-Info.plist`
- Generating dummy source at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/RandomGenerator/RandomGenerator-dummy.m`
- Installing Aggregate Targets
- Installing target `Pods-App` iOS 12.0
- Generating Info.plist file at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/Pods-App/Pods-App-Info.plist`
- Generating module map file at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/Pods-App/Pods-App.modulemap`
- Generating umbrella header at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/Pods-App/Pods-App-umbrella.h`
- Generating dummy source at
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support
Files/Pods-App/Pods-App-dummy.m`
- Stabilizing target UUIDs
- Running post install hooks
- Writing Xcode project file to
`../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Pods.xcodeproj`
Cleaning up sandbox directory
- Writing Lockfile in `../../../../../../../../var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Podfile.lock`
- Writing Manifest in `../../../../../../../../private/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Manifest.lock`
Integrating client project
[!] Please close any current Xcode sessions and use `App.xcworkspace` for this project from now on.
Integrating target `Pods-App` (`../../../../../../../../var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/App.xcodeproj` project)
Adding Build Phase '[CP] Embed Pods Frameworks' to project.
Adding Build Phase '[CP] Check Pods Manifest.lock' to project.
-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Building with `xcodebuild`.
$ /usr/bin/xcodebuild clean build -workspace /var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/App.xcworkspace -scheme App
-configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=C1A6D42E-F49B-43EF-B367-B698E97A422A
Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = iphonesimulator12.2
note: Using new build system
** CLEAN SUCCEEDED **
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: no rule to process file '/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator/RandomGenerator/RandomGenerator.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'x86_64' (in target 'RandomGenerator')
Build system information
warning: no rule to process file '/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator/RandomGenerator/Podfile' of type 'text' for architecture 'x86_64' (in target 'RandomGenerator')
Build system information
warning: no rule to process file '/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator/RandomGenerator/RandomGenerator.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'x86_64' (in target 'RandomGenerator')
Build system information
warning: no rule to process file '/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator/RandomGenerator/RandomGenerator.podspec' of type 'text' for architecture 'x86_64' (in target 'RandomGenerator')
Build system information
warning: duplicate output file '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist' on task: ProcessInfoPlistFile /Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist /var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/Target Support Files/RandomGenerator/RandomGenerator-Info.plist (in target 'RandomGenerator')
Build system information
error: Multiple commands produce '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist':
1) Target 'RandomGenerator' (project 'Pods') has copy command from '/var/folders/zc/rtmmz52s03q3pl4vgb06psy00000gn/T/CocoaPods-Lint-20190703-3687-1fmtamf-RandomGenerator/Pods/RandomGenerator/RandomGenerator/RandomGenerator/Info.plist' to '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist'
2) Target 'RandomGenerator' (project 'Pods') has process command with output '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist'
** BUILD FAILED **
Testing with `xcodebuild`.
-> RandomGenerator (2.0.0)
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: no rule to process file 'RandomGenerator/RandomGenerator/RandomGenerator.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'x86_64' (in target 'RandomGenerator')
- NOTE | [iOS] xcodebuild: warning: no rule to process file 'RandomGenerator/RandomGenerator/Podfile' of type 'text' for architecture 'x86_64' (in target 'RandomGenerator')
- NOTE | [iOS] xcodebuild: warning: no rule to process file 'RandomGenerator/RandomGenerator/RandomGenerator.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'x86_64' (in target 'RandomGenerator')
- NOTE | [iOS] xcodebuild: warning: no rule to process file 'RandomGenerator/RandomGenerator/RandomGenerator.podspec' of type 'text' for architecture 'x86_64' (in target 'RandomGenerator')
- NOTE | [iOS] xcodebuild: warning: duplicate output file '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist' on task: ProcessInfoPlistFile /Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist Target Support Files/RandomGenerator/RandomGenerator-Info.plist (in target 'RandomGenerator')
- NOTE | [iOS] xcodebuild: error: Multiple commands produce '/Users/elitia/Library/Developer/Xcode/DerivedData/App-akwujhxkudfgkodyxpqvnonnahsn/Build/Products/Release-iphonesimulator/RandomGenerator/RandomGenerator.framework/Info.plist':
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error and 1 warning.
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.1/lib/cocoapods/command/spec/lint.rb:94:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
I solved the problem my own.
For anyone facing the same issue as I did, here is what I did :
Make a new Xcode project.
Re-create the podspec file
Add a .swift-version file
Correct the spec for sources files as follow : spec.source_files = "POD NAME", "POD NAME/**/*.{h,m}"
and it worked after following these steps.