Open houmie opened 2 years ago
Hi @houmie , where are you getting the error you describe?
ld: framework not found AdColony
I'm assuming you're importing AdColony
and the compiler gives you a shout at that line. Are you using some kind of compiler test before importing the dependency as mentioned in this section?
#if canImport(AdColony)
import AdColony
#endif
Does the compiler complain on macOS or iOS?
Hi @fermoya
Thank you for coming back to me.
I get the error when compiling the project.
I'm using AdColony as mediation with Google Admob. I just did a search in the code and I'm nowhere importing AdColony directly. It's rather installed as dependency of GoogleMobileAdsMediationAdColony
, which is already excluded. But I think your script may not exclude the dependencies of that Pod above, could that be the case?
But I exclude GoogleMobileAds like this:
#if iOS
import GoogleMobileAds
#endif
class MainViewController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate {
#if iOS
var rewardedAd: GADRewardedAd?
#endif
Please see compiler error below:
Ld /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/myProject.app/Contents/MacOS/myProject normal (in target 'myProject' from project 'myProject')
cd /Users/houmie/Projects/myProject/apple
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios13.1-macabi -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -L/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/swift -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/PackageFrameworks -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/PackageFrameworks -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/PackageFrameworks -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/CryptoSwift-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseABTesting-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseCore-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseCoreDiagnostics-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseCrashlytics-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseInstallations-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/FirebaseRemoteConfig-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/GoogleDataTransport-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/GoogleUtilities-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/IQKeyboardManagerSwift -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/KeychainAccess-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/Keys-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/MMWormhole-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/OpenVPNAdapter-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/PromisesObjC-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/SSZipArchive-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/SwiftyBeaver-iOS -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/lottie-ios -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/nanopb-iOS -F/Users/houmie/Projects/myProject/apple/Pods/FBAEMKit/XCFrameworks -F/Users/houmie/Projects/myProject/apple/Pods/FBSDKCoreKit/XCFrameworks -F/Users/houmie/Projects/myProject/apple/Pods/FBSDKCoreKit_Basics/XCFrameworks -F/Users/houmie/Projects/myProject/apple/Pods/FBSDKShareKit/XCFrameworks -F/Users/houmie/Projects/myProject/apple/Pods/FirebaseAnalytics/Frameworks -F/Users/houmie/Projects/myProject/apple/Pods/GoogleAppMeasurement/Frameworks -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FBAEMKit -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FBSDKCoreKit -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FBSDKCoreKit_Basics -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FBSDKShareKit -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FirebaseAnalytics/AdIdSupport -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/GoogleAppMeasurement/AdIdSupport -F/Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/GoogleAppMeasurement/WithoutAdIdSupport -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/System/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/System/Library/Frameworks -filelist /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Intermediates.noindex/myProject.build/Debug-maccatalyst/myProject.build/Objects-normal/arm64/myProject.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @loader_path/../Frameworks -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -object_path_lto -Xlinker /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Intermediates.noindex/myProject.build/Debug-maccatalyst/myProject.build/Objects-normal/arm64/myProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L/System/iOSSupport/usr/lib/swift -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Intermediates.noindex/myProject.build/Debug-maccatalyst/myProject.build/Objects-normal/arm64/myProject.swiftmodule -ObjC -ObjC -lc++ -liconv -lsqlite3 -lz -framework CoreGraphics -framework CoreTelephony -framework CryptoSwift -framework FBAEMKit -framework FBLPromises -framework FBSDKCoreKit -framework FBSDKCoreKit_Basics -framework FBSDKShareKit -framework FirebaseABTesting -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseCrashlytics -framework FirebaseInstallations -framework FirebaseRemoteConfig -framework Foundation -framework GoogleAppMeasurement -framework GoogleAppMeasurementIdentitySupport -framework GoogleDataTransport -framework GoogleUtilities -framework IQKeyboardManagerSwift -framework KeychainAccess -framework Keys -framework Lottie -framework MMWormhole -framework NetworkExtension -framework OpenVPNAdapter -framework QuartzCore -framework SSZipArchive -framework Security -framework StoreKit -framework SwiftyBeaver -framework SystemConfiguration -framework UIKit -framework WatchConnectivity -framework nanopb -ObjC -lc++ -liconv -lsqlite3 -lstdc++ -lz -framework AVFoundation -framework AdColony -framework AdColonyAdapter -framework AdSupport -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreServices -framework CoreTelephony -framework CoreVideo -framework FBLPromises -framework FBSDKCoreKit -framework FBSDKShareKit -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseCrashlytics -framework FirebaseInstallations -framework Foundation -framework GoogleAppMeasurement -framework GoogleDataTransport -framework GoogleMobileAds -framework GoogleUtilities -framework IQKeyboardManagerSwift -framework JavaScriptCore -framework KeychainAccess -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework NetworkExtension -framework OpenVPNAdapter -framework QuartzCore -framework SSZipArchive -framework Security -framework StoreKit -framework SwiftyBeaver -framework SystemConfiguration -framework UIKit -framework UserMessagingPlatform -framework WebKit -framework nanopb -weak_framework Accelerate -weak_framework Accounts -weak_framework AdSupport -weak_framework AppTrackingTransparency -weak_framework AudioToolbox -weak_framework CoreGraphics -weak_framework Foundation -weak_framework JavaScriptCore -weak_framework QuartzCore -weak_framework SafariServices -weak_framework Security -weak_framework Social -weak_framework StoreKit -weak_framework UIKit -weak_framework WatchConnectivity -weak_framework WebKit -ObjC -ObjC -lc++ -liconv -lsqlite3 -lz -framework CoreGraphics -framework CoreTelephony -framework CryptoSwift -framework FBAEMKit -framework FBLPromises -framework FBSDKCoreKit -framework FBSDKCoreKit_Basics -framework FBSDKShareKit -framework FirebaseABTesting -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseCrashlytics -framework FirebaseInstallations -framework FirebaseRemoteConfig -framework Foundation -framework GoogleAppMeasurement -framework GoogleAppMeasurementIdentitySupport -framework GoogleDataTransport -framework GoogleUtilities -framework IQKeyboardManagerSwift -framework KeychainAccess -framework Keys -framework Lottie -framework MMWormhole -framework NetworkExtension -framework OpenVPNAdapter -framework QuartzCore -framework SSZipArchive -framework Security -framework StoreKit -framework SwiftyBeaver -framework SystemConfiguration -framework UIKit -framework WatchConnectivity -framework nanopb -lwg-go -framework StoreKit -framework NetworkExtension -framework Pods_myProject -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Intermediates.noindex/myProject.build/Debug-maccatalyst/myProject.build/Objects-normal/arm64/myProject_dependency_info.dat -o /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Products/Debug-maccatalyst/myProject.app/Contents/MacOS/myProject -Xlinker -add_ast_path -Xlinker /Users/houmie/Library/Developer/Xcode/DerivedData/myProject-ewigkyiwmukfdibbvzefbzcdfqhi/Build/Intermediates.noindex/WireGuardKit.build/Debug-maccatalyst/WireGuardKit.build/Objects-normal/arm64/WireGuardKit.swiftmodule
ld: framework not found AdColony
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is so strange..what could it be?
@houmie the error displays Debug-maccatalyst
, that means you're compiling for macOS
and yet, #if iOS
resolves true and tries to import
the framework.
macCatalyst
used iOS SDK under the hood so that condition resolves to true
. The error should be resolved if you change:
#if iOS
import GoogleMobileAds
#endif
To
#if canImport(GoogleMobileAds)
import GoogleMobileAds
#endif
Or
#if !targetEnvironment(macCatalyst)
import GoogleMobileAds
#endif
Please give it a try.
@fermoya Thanks Fernando.
I just tried that replaced all of #if iOS
with #if !targetEnvironment(macCatalyst)
.
But sadly I get the exact same error when building the project. I cleaned the build folder and even ran pod catalyst run
again. But same issue :-(
@houmie I've prepared a branch where I've added the problematic dependencies to my Sample
project, you can find it here:
https://github.com/fermoya/cocoapods-catalyst-support/tree/fix/issue-36/Sample
Can you please download that code and let me know if it compiles? I can make it compile. Check out how I import the framework: https://github.com/fermoya/cocoapods-catalyst-support/blob/fix/issue-36/Sample/Sample/ViewController.swift
Both iOS and macCatalyst compile. The former crashes as I'm not initializing Google Mobile Ads SDK
whereas the latter compiles, runs and prints Not imported
.
I'm seeing no issue with those two pods (GoogleMobileAdsMediationAdColony
and Google-Mobile-Ads-SDK
)
Hello @fermoya
Thank you for the branch provided. I have tried your project and can confirm that it works. I still don't know what is causing the issue in my project. You have seen the output earlier yourself. I think the target might be a bit old as I have it for a few years and maybe some setting in it is not up-to-date.
Even though if I'd bypass that the next issue with Wireguard came down to hit me. So I'm pretty much about to give up on Catalyst altogether before even reaching a consensus what actually went wrong here. Thanks again.
@houmie might be worth trying [bundle exec] pod deintegrate
then [bundle exec] pod install
remove the [bundle exec]
from the commands if you aren’t using a Gemfile. If you haven’t already, deleting derived data manually might help rm -rf ~/Library/Developer/Xcode/DerivedData
.
This is an amazing project. Thanks for the hard work you have put into this.
AdColony doesn't get properly filtered out I have come across an anomaly with removing Google Admob and its dependencies.
The verbose message below looks good to me. In theory it's finding all the incompatible libraries, but in practice I still can't build the project. The error I'm getting is:
ld: framework not found AdColony
Podfile
Environment
Many Thanks