ld: library not found for -lswiftMetal for architecture x86_64
$ pod --version
1.4.0.rc.1
🌈 I've read and understood the *CONTRIBUTING guidelines and have done my best effort to follow.
Report
What did you do?
First I created a podspec with swift and some dependencies. The podspec looks as follows and can be included like so:
pod 'YieldloveAdIntegration', '~> 0.0.9'
Pod::Spec.new do |spec|
spec.name = 'YieldloveAdIntegration'
spec.version = '1.0.0'
spec.summary = 'We help publishers unlock the full ad revenue potential of their websites and apps.'
spec.license = { :type => 'Commercial', :file => 'LICENSE' }
spec.description = 'We help publishers unlock the full ad revenue potential of their websites and apps. Our platform ensures that every single ad impression is sold for the highest price possible.'
spec.homepage = 'https://www.yieldlove.com/'
spec.author = { 'Pascal Salesch' => '[email protected]' }
spec.source = { :git => 'https://github.com/yieldlove/ad-integration-ios-app.git', :tag => spec.version.to_s }
spec.requires_arc = false
spec.platforms = { :ios => '8.0' }
spec.vendored_frameworks = [
'GoogleMobileAdsSdkiOS-7.27.0/GoogleMobileAds.framework',
'InMobiAdapter-6.2.1.0/InMobiAdapter.framework'
]
spec.source_files = [
'Yieldlove/*.swift'
]
end
Then I created a new Objective-C Single Page App in XCode. Ran "pod init" and edited the podfile:
platform :ios, '9.0'
install! 'cocoapods', :deterministic_uuids => false, :integrate_targets => false
target 'YIeldloveObjCTest' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'YieldloveAdIntegration', '~> 0.0.9'
# Pods for YIeldloveObjCTest
target 'YIeldloveObjCTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'YIeldloveObjCTestUITests' do
inherit! :search_paths
# Pods for testing
end
end
What did you expect to happen?
The XCode Workspace to build without errors
What happened instead?
I got the following error:
ld: library not found for -lswiftMetal for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Full error:
Ld /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator/YIeldloveObjCTest.app/YIeldloveObjCTest normal x86_64
cd /Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest
export IPHONEOS_DEPLOYMENT_TARGET=11.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -L/Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator -L/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/AdMobMediationAdapterFlurry/FlurryAdapter -F/Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/AdColony -FPods/MobFoxSDK -FPods/MobFoxSDK/MobFoxSDKCore.embeddedframework -FPods/TapjoySDK -FPods/TapjoySDK/TapjoySDK_iOS_v11.11.1 -FPods/TapjoySDK/TapjoySDK_iOS_v11.11.1/Libraries -FPods/TapjoySDK/TapjoySDK_iOS_v11.11.1/Libraries/Tapjoy.embeddedframework -FPods/TapjoySDK/TapjoySDK_iOS_v11.11.1/Libraries/Tapjoy.embeddedframework/Resources -FPods/TapjoySDK/TapjoySDK_iOS_v11.11.1/Libraries/Tapjoy.embeddedframework/Resources/TapjoyResources.bundle -F/Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator/Flurry-iOS-SDK -F/Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator/YieldloveAdIntegration -F/Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator/mopub-ios-sdk -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/AppLovinSDK/applovin-ios-sdk-4.6.1 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/Google-Mobile-Ads-SDK/Frameworks/frameworks -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/GoogleMobileAdsMediationAdColony/AdColonyAdapter-3.2.1.1 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/GoogleMobileAdsMediationAppLovin/AppLovinAdapter-4.6.1.0 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/GoogleMobileAdsMediationInMobi/InMobiAdapter-7.0.4.0 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/GoogleMobileAdsMediationMoPub/MoPubAdapter-4.19.0.0 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/GoogleMobileAdsMediationTapjoy/TapjoyAdapter-11.11.1.0 -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/InMobiSDK -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/MobFoxSDK/MobFoxSDKCore.embeddedframework -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/MobFoxSDK -F/Users/yieldlove/Desktop/YieldlovePodTest/YIeldloveObjCTest/Pods/TapjoySDK/TapjoySDK_iOS_v11.11.1/Libraries/Tapjoy.embeddedframework -filelist /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Intermediates.noindex/YIeldloveObjCTest.build/Debug-iphonesimulator/YIeldloveObjCTest.build/Objects-normal/x86_64/YIeldloveObjCTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Intermediates.noindex/YIeldloveObjCTest.build/Debug-iphonesimulator/YIeldloveObjCTest.build/Objects-normal/x86_64/YIeldloveObjCTest_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lFlurryAdapter -lc++ -lsqlite3.0 -lxml2 -lz -framework AVFoundation -framework AdColony -framework AdColonyAdapter -framework AdSupport -framework AppLovinAdapter -framework AppLovinSDK -framework AudioToolbox -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework EventKit -framework Flurry_iOS_SDK -framework Foundation -framework GLKit -framework GoogleMobileAds -framework ImageIO -framework InMobiAdapter -framework InMobiSDK -framework MATMoatMobileAppKit -framework MapKit -framework MediaPlayer -framework MessageUI -framework MoPub -framework MoPubAdapter -framework MobFoxSDKCore -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework SafariServices -framework Security -framework Social -framework StoreKit -framework SystemConfiguration -framework Tapjoy -framework TapjoyAdapter -framework UIKit -framework WebKit -framework YieldloveAdIntegration -weak_framework AdSupport -weak_framework CoreTelephony -weak_framework JavaScriptCore -weak_framework SafariServices -weak_framework StoreKit -weak_framework WebKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Intermediates.noindex/YIeldloveObjCTest.build/Debug-iphonesimulator/YIeldloveObjCTest.build/YIeldloveObjCTest.app.xcent -framework Pods_YIeldloveObjCTest -Xlinker -dependency_info -Xlinker /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Intermediates.noindex/YIeldloveObjCTest.build/Debug-iphonesimulator/YIeldloveObjCTest.build/Objects-normal/x86_64/YIeldloveObjCTest_dependency_info.dat -o /Users/yieldlove/Library/Developer/Xcode/DerivedData/YIeldloveObjCTest-bldxupjdlpqebjeuuscsbaommbzc/Build/Products/Debug-iphonesimulator/YIeldloveObjCTest.app/YIeldloveObjCTest
CocoaPods Environment
Stack
CocoaPods : 1.4.0.rc.1
Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
RubyGems : 2.7.3
Host : Mac OS X 10.13.1 (17B1003)
Xcode : 9.0.1 (9A1004)
Git : git version 2.13.5 (Apple Git-94)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 084f59c765f86cd70c857fa4e9548999fcff315c
Installation Source
Executable Path: /usr/local/bin/pod
Plugins
cocoapods-deintegrate : 1.0.1
cocoapods-packager : 1.5.0
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.3.0
cocoapods-try : 1.1.0
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
install! 'cocoapods', :deterministic_uuids => false, :integrate_targets => false
target 'YIeldloveObjCTest' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'YieldloveAdIntegration', '~> 0.0.9'
# Pods for YIeldloveObjCTest
target 'YIeldloveObjCTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'YIeldloveObjCTestUITests' do
inherit! :search_paths
# Pods for testing
end
end
I'm not sure if I want to close the issue, but the problem is that the project should have atleast one swift file. (the file can be empty)
https://forums.developer.apple.com/message/264817#264817
Does adding:
spec.framework = 'Metal'
help?
No unfortunately not.
I additionally tried adding spec.weak_frameworks = 'Metal'
but the same error occurs (when there is no .swift file in the project).
Cleaning the project solved the problem for me