Closed jgberg closed 10 years ago
the header file is in the MobFox.framework coming with plugin, it should be copied and added to project automatically.
could you please check whether it exists?
Here are the files located under the Cordova app in ./platforms/ios/App/Plugins/com.rjfun.cordova.mobfox/
CDVMobFox.h CDVMobFox.m libGoogleAdMobAds.a libMovFoxAds.a MobFox.framework MobFoxAds.h
The header is there, but it's not finding it...
Can you check whether the MobFox.framework has been added to the project?
If not, manually add it.
I haven't even looked at Xcode yet because it won't compile with: cordova build which has to run first. And it won't. But anyway, here's what you asked for...
You don't have to run cordova build
, just let Xcode to build and check the error.
Sometimes the cordova CLI script does not add file correctly, and I found it often fail to bulid or install after upgrade to Cordova v3.6.3. But it works fine in Xcode.
cordova prepare
must be run first.
No that isn't right: You have to run Cordova Build if you work in in CordovaApp/www so that it gets copied into the platforms directory, each and every time you make a change there. And working without Xcode that way is documented by Apache.
With that said, I did a cordova prepare which fixed nothing.
Can you please simply create a vanilla Cordova 3.6 app, install your plugin and do a cordova build... that's all I did... It's completely vanilla and should work...
I think the way you're including it isn't right... It's like not on the path for the include... I've given you the exact compilation line above... But i'm not an Xcode guy, so I don't know how to fix it... Even though i've done C++ and C for years and years, Objective-C and Xcode looks like a rats nest to me and I'm afraid to touch anything.
It is cordova prepare
do the copying work.
cordova prepare # copy
cordova build # copy and build
cordova run # copy, build, and install to device/simulator to run
After running this command, please import the ios project into Xcode, to see what was happening. I guess the MobFox.framework is not added correctly by cordova CLI. (very minor situation it may happen with unknown reason)
That's what I did and it fails on the build before I ever get to Xcode... It fails on the 2nd line above...
only run cordova prepare
, it only copy file, and will not build.
then import into Xcode, and check whether MobFox.framework is added, like the screenshot I post.
it's not wrong. any header file in a framework should be include like this.
From what I can see, it's there...
yes, i see, it's weird.
I re-test the plugin with following commands, and ... no problem.
cordova create test1 com.rjfun.test1 test1;
cd test1;
cordova platform add ios;
cordova platform add android;
cordova plugin add com.rjfun.cordova.mobfox;
rm -r www/*;
cp -r plugins/com.rjfun.cordova.mobfox/test/* www/;
cordova prepare;
cordova run android;
cordova run ios;
it build okay with cordova CLI, but has some problem connecting device and install.
so I build it in xcode and run, i get following screen:
can you try re-create a clean project and test my steps above?
I have a clean project... I have done this a lot already. Are you running Cordova 3.6 ? I also don't do android yet. The only difference is that that my create line is slightly different than yours: cordova create zines-Cordova3.6 com.blahblah.app Zines Your directory and app name are the same... maybe that causes and issue?
When I look at the 'mobfox framework' in your plugin it does not have symbolic links at the top level to reach in the A directory and below... I see this described in some docs somewhere... Does your install have such symlinks? The error suggest the framework isn't setup right, causing the import to fail..
So heres an ls of the MobFox.framework installed in your plugin:
ls -RF MobFox.framework
Versions/
MobFox.framework/Versions:
A/
MobFox.framework/Versions/A:
Headers/ MobFox Resources/
MobFox.framework/Versions/A/Headers:
MobFox.h MobFoxTableViewHelper.h
MobFoxBannerView.h MobFoxVideoInterstitialViewController.h
MobFoxNativeAdController.h
MobFox.framework/Versions/A/Resources:
Info.plist LICENSE.txt MPCloseButtonX.png README.markdown
LICENSE MPAdBrowserController.nib MPCloseButtonX@2x.png README.txt
Yes, I am using cordova 3.6.3
As to the symbol links. As I cannot find any clue from your problem, so I just did a update, and remove the symbol links from MobFox.framework. (but frankly, it should be any problem, as I tested both pass before commit and publish. so weird)
I cannot explain your problem. Can you pack your project in a zip and give me a download link?
What symbolic links do you have? I have NONE in the plugin or in the MobFox.framework... Can you do an 'ls -RF" of the MobFox.framework?
BTW, my env:
Mac OS: v10.9.5 Xcode: v6.0.1 Cordova: v3.6.3
Any difference?
I'm running the latest of all three... the same as you. Cordova: 3.6.3-0.2.13 (via cordova -v)
No clue at all.
The only thing I can imagine is the framework is not recognized correctly.
Can you remove the MobFox.framework, and then re-add it manually?
downloaded, may remove the file now.
I did not find any symbol links in the MobFox.framework of your project. It's the root cause.
I think cordova CLI did not handle the symbol links correctly.
Can you update to plugin v1.0.1? I just removed all the symbol links and use direct files.
how do i update to plugin v1.0.1?
cordova plugin rm com.rjfun.cordova.mobfox
cordova plugin add com.rjfun.cordova.mobfox
then check the config.xml in plugin folder and make sure the version code is: 1.0.1, like this:
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.rjfun.cordova.mobfox"
version="1.0.1">
That worked! That is: cordova prepare;cordova build resulted in a successful compile.
Ok... I'll look at using it in the morning... Thanks.
getting this compilation issue under Xcode:
it's a warning when assign long to int, may ignore it.
I just like cleanliness... but ok
Hello Raymond, Thanks for creating this plugin. There's a problem though. After I've installed it under a new install of Cordova 3.6 by
cordova plugin add com.rjfun.cordova.mobfox
And then I try to compile it using Xcode 6.x via:cordova build
the compilation fails with the following error: