Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AdMob: Could not find auto-linked framework 'FBLPromises'

I have a Objective C project and I want to add AdMob to it. Been following https://developers.google.com/admob/ios/quick-start#objective-c

I get the linker error ld: warning: Could not find auto-linked framework 'FBLPromises' Undefined symbols for architecture arm64: "_OBJC_CLASS_$_UIScene"

I'm adding the frameworks manually. I dragged them in.

The tutorial doesn't say anything about the promises framework, but it comes in their download. And if I don't add it, I get a linker error saying a function is missing.

All of the frameworks are in the project and in Link With Binary Libraries list.

I tried deleting them and re-adding them, and quitting Xcode and clean build.

I tried adding framework search paths $(inherited) and $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) and the folder they are in with recursive $(PROJECT_DIR)/Frameworks and all of their exact paths individually also.

I tried adding a new swift file to the project so that it becomes hybrid.

I added -ObjC linker flag to Other Linker Flags, and $(inherited)

The tutorial says to add "GoogleUtilities.framework" But what I downloaded has "GoogleUtilities.xcframework" folder. So I tried adding the folder both as a group and as not, and I tried adding the framework files in the folder only.

I tried making a new project with nothing else.

Can anyone get AdMob to work on an Objective C project with adding frameworks manually?

I have agreed to the latest terms from apple and have a paid developer account.

like image 616
Curtis Avatar asked May 18 '20 08:05

Curtis


3 Answers

I had a similar error in a Swift project.

Undefined symbol: _OBJC_CLASS_$_JSContext

In my case the solution was to add the JavaScriptCore.framework to the project.

like image 168
dmatzke Avatar answered Oct 04 '22 08:10

dmatzke


Figured out the issue for a hybrid project!

The project I was linking to used an ObjC Bridging Header, so I simply needed to import Firebase in the header file:

// ObjC-Bridging-Header.h
#import "Firebase.h"

Not sure if this relates to a pure ObjC project, but you might be able to add a dummy Swift file to make it a hybrid project and use the bridging header.

like image 26
Mark Avatar answered Oct 04 '22 09:10

Mark


I had the same error. I had forgotten to add the following libs: nanopb.xcframework, PromisesObjC.xcframework, UserMessagingPlatform.framework - included in GoogleMobileAdsSdkiOS.. I just added the missed libraries and now everything is OK.

like image 20
Panayot Avatar answered Oct 04 '22 09:10

Panayot