iOS Build Environment Help Center

Linking UnityFramework - ld: file not found

append delete JoshuaF

Windows version: Windows 11 64bit
Builder version: 3.60.2 with CocoaPods daemon
iOS SDK version: 17.2
Run log: https://pmbaty.com/paste/?fd3b0032c66c2c86#7GyuPPDG97MDC2L9NCmS549xSNTHTypFers3pTbMYW3d

Hello,
I got the asset from the unity asset store and followed the instructions from the readme page for the tool setup. Using Google Mobile Ads Unity plugin v8.60 from https://github.com/googleads/googleads-mobile-unity/releases.

My guess is that Google Mobile Ads Unity plugin v8.60 is using Google Mobile Ads iOS SDK 10.13 but the cocoapod daemon is installing Google-Mobile-Ads-SDK (10.14.0).

The xcode project is built successfully but running the build and deploy in the Project builder results in the error given in the Run log.

can somebody help with this?
Regards

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

I don’t think the cause is a version mismatch. Unless the same build by Xcode on Mac fails identically. Do you have the possibility to test that ?

append delete #2. JoshuaF

No, dont have a way to test it. Got the sdk from a friend who lives far.

append delete #3. Pierre-Marie Baty

OK. Can you please send me a (possibly stripped down) version of this Xcode project that shows this behaviour so that I reproduce the problem and study it ? Confidentiality is guaranteed. Thanks in advance.

append delete #4. JoshuaF

Hey, sent a gdrive link with the zip of the xcode project (to pm @ thisdomain.com). Not stripped down.

append delete #5. Pierre-Marie Baty

Well received. I'll post back with more info.

append delete #6. Pierre-Marie Baty

All I can say so far is that I could reproduce the problem, and I'm still looking for the cause...

append delete #7. JoshuaF

Hey,
Cool, if you need any additional details I would be happy to provide them.
Would be great if you keep me updated.

append delete #8. Pierre-Marie Baty

Update: I scoured the source code of your project, including the source code downloaded by CocoaPods. The "GADNativeCustomTemplateAd" symbol that's causing problem is defined... nowhere. It is *declared* in Libraries/Plugins/iOS/GADUNativeCustomTemplateAd.h as an Objective-C property, and used as a return type in Libraries/Plugins/iOS/GADUNativeCustomTemplateAd.m and Libraries/Plugins/iOS/GADUAdLoader.m. But the *definition* for this object (i.e. the layout of its contents) appears nowhere.

For this reason I'm forced to the preliminary conclusion that your project must be bogus, and I can't see how Xcode could compile this successfully. Before giving a final assessment I'm going to try building it on Xcode, but I have to upgrade my macOS to Sonoma first for the required Xcode version to run (something I wanted to avoid, but that's another story). If Xcode can't build it, you'll need to look for the cause in your Unity project, it will not be the builder's fault. If it can, then I'll be quite stumped for I fail to see how a compiler can compile an object for which it's not given a detailed specification.

:: @Pierre-Marie Baty added on 15 Jan ’24 · 15:30

*edit* This is confirmed. Xcode itself cannot build your project.

% Xcode's build log
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:12:31: error: cannot find protocol declaration for 'GADRewardedAdDelegate'; did you mean 'GADNativeAdDelegate'?
@interface GADURewardedAd () <GADRewardedAdDelegate>
                              ^~~~~~~~~~~~~~~~~~~~~
                              GADNativeAdDelegate
In module 'GoogleMobileAds' imported from /Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.h:5:
/Users/pmbaty/Library/Developer/Xcode/DerivedData/Unity-iPhone-fslpzlqfckrgoigrafrchegzovuh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK/GoogleMobileAds.framework/Headers/GADNativeAdDelegate.h:13:11: note: 'GADNativeAdDelegate' declared here
@protocol GADNativeAdDelegate <NSObject>
          ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:27:42: error: no visible @interface for 'GADRewardedAd' declares the selector 'initWithAdUnitID:'
    _rewardedAd = [[GADRewardedAd alloc] initWithAdUnitID:adUnitID];
                   ~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:46:34: error: type-id cannot have a name
             completionHandler:^(GADRequestError *_Nullable error) {
                                 ^~~~~~~~~~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:46:50: error: expected ')'
             completionHandler:^(GADRequestError *_Nullable error) {
                                                 ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:46:33: note: to match this '('
             completionHandler:^(GADRequestError *_Nullable error) {
                                ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:46:32: warning: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
             completionHandler:^(GADRequestError *_Nullable error) {
                               ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:47:20: error: use of undeclared identifier 'error'
               if (error) {
                   ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:51:52: error: use of undeclared identifier 'error'
                                                  [error localizedDescription]];
                                                   ^
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:45:20: error: no visible @interface for 'GADRewardedAd' declares the selector 'loadRequest:completionHandler:'
  [self.rewardedAd loadRequest:request
   ~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:64:27: error: no visible @interface for 'GADRewardedAd' declares the selector 'isReady'
  return [self.rewardedAd isReady];
          ~~~~~~~~~~~~~~~ ^~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:68:24: error: no visible @interface for 'GADRewardedAd' declares the selector 'isReady'
  if ([self.rewardedAd isReady]) {
       ~~~~~~~~~~~~~~~ ^~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:70:22: error: no visible @interface for 'GADRewardedAd' declares the selector 'presentFromRootViewController:delegate:'
    [self.rewardedAd presentFromRootViewController:unityController delegate:self];
     ~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.m:77:39: warning: 'adNetworkClassName' is deprecated: Deprecated. Use loadedAdNetworkResponseInfo.adNetworkClassName instead. [-Wdeprecated-declarations]
  return self.rewardedAd.responseInfo.adNetworkClassName;
                                      ^
In module 'GoogleMobileAds' imported from /Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.h:5:
/Users/pmbaty/Library/Developer/Xcode/DerivedData/Unity-iPhone-fslpzlqfckrgoigrafrchegzovuh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK/GoogleMobileAds.framework/Headers/GADResponseInfo.h:80:71: note: 'adNetworkClassName' has been explicitly marked deprecated here
@property(nonatomic, readonly, nullable) NSString *adNetworkClassName GAD_DEPRECATED_MSG_ATTRIBUTE(
                                                                      ^
In module 'GoogleMobileAds' imported from /Users/pmbaty/Desktop/JoshuaF-CocoaPodsGoogleAds/Libraries/Plugins/iOS/GADURewardedAd.h:5:
/Users/pmbaty/Library/Developer/Xcode/DerivedData/Unity-iPhone-fslpzlqfckrgoigrafrchegzovuh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK/GoogleMobileAds.framework/Headers/GoogleMobileAdsDefines.h:10:56: note: expanded from macro 'GAD_DEPRECATED_MSG_ATTRIBUTE'
#define GAD_DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                       ^
2 warnings and 10 errors generated.
%

I suggest you start over and redo the Google integration properly. If you're certain you did it right, then this release of your Google asset is bogus and you should file a bug report where it belongs.

append delete #9. JoshuaF

Hey,
Thanks for the update. Looks like you are right.
This was an old game which had an older version of google ads sdk. I deleted it and installed the latest version but I guess there were some files from the old version that were not deleted. Removed all the google sdk files and it worked! Able to build and deploy to my iPhone, Thanks! :)

On a side note: I kinda understood how the "Add extra framework" button works, but had a doubt regarding the tabs - "Main App", "Game Assembly" and "Unity Framework". What are these for? (probably to insert the fw where required, but how do we know which one to use when? does it state it in the error?) and in the google ads sdk example in the dev docs it doesnt specify which one to use. Can you give an idea?

append delete #10. Pierre-Marie Baty

Yep. These are the "targets" (equivalent of Visual Studio "projects" in Apple's terminology) of the Xcode solution. The one to add your frameworks to is usually "UnityFramework", because that's the one where your game logic is and where the APIs that belong to these extra frameworks are used. The "main app" is just a thin bootstrap wrapper for the application, and the "GameAssembly" target is the Unity engine's il2cpp soup.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty