Open ghost opened 6 years ago
I had the same error building from Visual Studio after updating the plugins for admob with facebook mediation. When building with xcode the error was a bit more explicit. FBKVOController that is referenced from FBAudienceNetwork is not found.
The error is actually in the plugin cordova-plugin-audnet-sdk that facebookads depends on. The master for audnet-sdk here on github have the KVOController.framework so I installed the plugins from there: cordova plugin add https://github.com/floatinghotpot/cordova-plugin-audnet-sdk.git cordova plugin add https://github.com/floatinghotpot/cordova-plugin-facebookads.git
The build succeeded BUT the app crashes when started. Ok so building and deploying to device in xcode gives the error that the framework could not be loaded. After som googling I found that if you in xcode under General add KVOController.framework to Embedded Binaries then it works properly. But that is not an option for me as I want to build from VS.
More googling and I found the source for KVOController here https://github.com/facebook/KVOController/tree/master/FBKVOController I have never built a plugin but looking at other plugins with source code I mimicked what they were doing.
<config-file target="config.xml" parent="/*">
<feature name="KVOController">
<param name="ios-package" value="KVOController"/>
</feature>
</config-file>
<header-file src="src/ios/KVOController.h" />
<header-file src="src/ios/FBKVOController.h" />
<source-file src="src/ios/FBKVOController.m" />
<header-file src="src/ios/NSObject+FBKVOController.h" />
<source-file src="src/ios/NSObject+FBKVOController.m" />
<!-- framework src="KVOController.framework" custom="true" / -->
And now it works. Hope this helps you until @floatinghotpot fixes this.
//Big
@BigFoppa amazing. you are just right. I found the same solution but not do it quick enough. Will update the plugin now.
Fixed and published as:
cordova-facebook-audnet-sdk@4.26.2
To be clear - We just add this in as a plugin above "cordova-plugin-facebookads"
@floatinghotpot Thanks for your great work! Just tested to remove plugins and install "cordova-plugin-admob-facebook". It brings in the updated versions of the plugins and it works perfectly.
@ekubischta As the latest versions of the plugins are now published to npm you only need to remove the plugins and install the facebookads plugin. It will thru its dependency bring in the latest version of "cordova-facebook-audnet-sdk".
@floatinghotpot I'm still getting the error for ios. I've installed cordova-facebook-audnet-sdk@4.26.2 and made sure the appropriate versions of the required plugins were installed. I also tried the fix that BigFoppa suggested installing from the repositories. (However, I didn't see 'KVOController.framework' available to embed).
Any other ideas on what I could try?
@Nakea forget about my workaround, you don't need that anymore. The plugin is fixed for this now. Are you sure its the same error? The KVOController.framework file is no longer needed. Remove the plugins you got installed and only install the cordova-plugin-facebookads. Or if you like me use admobpro with mediation then you install cordova-plugin-admob-facebook. /Big
Plugin used to build fine with PhoneGap Build. Then, recently - in the last few days, we started getting failed builds for IOS.
Any ideas?
Here is the bottom output of the logs: