PhoneGap template-based app failing to compile AdWhirl sources - objective-c

Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I cant find it now :( - PhoneGap is a static framework).
The app works ok on its own.
Now trying to add in AdWhirl. AdWhirl comes as source files - no library of its own, although there are libraries for the specific ad services you use.
I have added the folders to the project, but it does not seem to compile the AdWhirl sources - if amend/break the AdWhirl code, I get no compile errors.
Where I have included/imported the AdWhirl headers into my app, I had to tweak the related imports in AdWhirl files to find their dependancies - seems to be related to issue above.
I can get it compiling with that hack - but then fails to link - missing AdWhirlView, which also seems to be due to first issue - not being compiled, so not available to link.
Under build phases/compile sources, I have just 2 items: main.m and AppDelegate.m - do I need to add the AdWhirl code into here?
Here is a sample project with just the AdWhirl stuff, no PhoneGap, but still has the issue :(
Thanks in advance for any tips/pointers.

Just wanted to post the answer here that I gave on Twitter. Seems like the issue is that Xcode is unhappy with folder references. Try reimporting the AdWhirl files into your project, but tell Xcode to add groups for folders, rather than folder references. (Incidentally, if anyone knows why Xcode is choking on the folder references, I'd love to hear about it.)
Then, you'll start getting errors about ARC and missing files pertaining to the Google Ads framework. So, you'll have to add the Google Ads files to quell the errors; then, you'll want to make sure ARC is disabled in your project. If you want to use ARC, then your best bet is to repackage AdWhirl as a static library that builds without ARC, and have that as a dependency in your workspace.

Related

Is there any DSYM file for .framework (besides app)?

I am a new guy in OC programming. Now I am involved in a framework development project.
I know the framework works as a library, which contains a group of methods. It's not an application that can run on devices.
Actually, our framework will work with customer's application. We want to investigate what happened inside our framework when customer's application crashed. So I want the 'DSYM' file of our framework, instead of an application.
As far as I know any iOS application does have corresponded 'DSYM', but I didn't find the 'DSYM' of our framework.
Does iOS framework project have 'DSYM'? If it does have, how can I obtain it?
By the way, I am using Xcode 8.1.
Thanks!
According to my observations, .dSYM files are generated for iOS dynamic framework built with Release configuration only.
After build succeeds, the debug symbols files can be found at these paths, for a device and simulator, respectively:
<Build_Root>/build/Release-iphoneos/<Product_Name>.framework.dSYM
<Build_Root>/build/Release-iphonesimulator/<Product_Name>.framework.dSYM
, where
<Build_Root> is usually a subdirectory within Derived Data directory;
<Product_Name>is the name of your framework.
Yes, you can generate dSYMs for dynamic frameworks. There are a few relevant build settings that control whether and where these files are generated:
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym,
DWARF_DSYM_FOLDER_PATH = "$(CONFIGURATION_BUILD_DIR)",
DWARF_DSYM_FILE_NAME = "$(PRODUCT_NAME).dSYM"
Obviously, you can set these to whatever you want, either in your project's build settings in Xcode (the project.pbxproj file) or as arguments to xcodebuild (depending on how you generate your framework).
DSYM (Debugging SYMbols) files generally store the debugging symbols for your app. And if app crash any where symbols replaced with appropriate method name so that it could help developer in a readable form. And for that you can use the crash log and they can be find in the iPhone where the app is installed. Each app and device have their own crash log.
Also please check this link it might help you.
Read Crash Report
Upload Symbols for iOS Framework
Hopefully these might help you or guide in the right direction.

Xcode: how to build a static library project correctly?

This question will be easy for Xcode pros but for a MonoTouch developer it seems to be impossible to resolve. :-)
I'm using Xcode 4.5 and I want to target iOS 5.1 and above and iOS Simulator 5.1 and above.
I have a a library project here and it is coming with a prebuilt binary named "DemoLib" (no extension and it is 11MB in size). The library is a fat lib for Simulator and iOS 5.1+.
I can use that library without any problem.
However if I try to build the library myself, I end up with a "DemoLib.a" file (notice the extension and the size of 30MB). How can I get the same build result? What is a .a file compared to the file without extension?
I tried to build the project "for running", and "for archiving" in Xcode. Both results in the same 30MB .a file.
I was expecting some dropdown in Xcode where one could select "DEBUG" or "RELEASE" build and the latter one would create the smaller lib.
Of course I could never tell without seeing the framework's project file. Having said that, there is an excellent guide to creating and compiling iOS frameworks here: https://github.com/jverkoey/iOS-Framework
Using the above guide, you should be able to recreate your framework's project from scratch, add the files you have to it, and properly compile it.
Hope this helps! :)
Did it come with a Makefile? Create a new target, set the build settings of the target to what's in the Makefile, then set your project to depend on that new target.
A file with the .a is a static library, which means it depends on nothing external and all the code it needs is compiled inside it. I think no extension generally implies dynamic library, which means it'll depend on some dependencies being present on your system to link against. Maybe that's why the .a is so much bigger. I think Xcode will build static by default because iOS does not allow the use of dynamic libraries.
The dropdown for what to build is in your scheme. Command+shift+< to view your scheme. Within the scheme you can edit which environment each method of building will use.

Phonegap - Extend a plugin for iOS

I've been reading about how to create a new plugin for Phonegap and seems to get it by following this tutorial.
http://wiki.phonegap.com/w/page/36753496/How%20to%20Create%20a%20PhoneGap%20Plugin%20for%20iOS
However, I'm having a hard time grasping how to extend an existing plugin. (not creating a new one)
Been reading this tutorial.
http://hiediutley.com/2011/03/28/phonegap-tutorial-series-3-extending-the-phonegap-api/
I can't seem to get where I can possibly add line of codes to the .m file for example. In my XCode, I only see the .h files but not the .m file.
Or is there a better way to extend an api?
Thank you,
Tee
EDIT: This answer is no longer completely correct.
The latest versions of Cordova / PhoneGap do not come as a compiled framework and it is much easier (especially since 2.2.0) to tweak the version of cordova a particular app uses as it is simply a sub-project in XCode.
To get at the .m files you would have to download the PhoneGap (Cordova) iOS source and make your changes them compile your own version of the PhoneGap framework.
That is not as hard as it sounds, but can be a bit daunting if you are not super comfortable with Objective-C and command line compilation tools.
To paraphrase the README from the iOS source, for example:
$ git clone http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios.git
Make your changes, then...
Launch "Terminal.app"
Navigate to the folder where the Makefile is (./PhoneGapLib ?)
Type in make then press Enter
This should build "PhoneGapInstaller.dmg" into the dist folder. This is what you use to install your new version of PhoneGap.
Another option is to take the .m and .h files of the API you are extending (by simply getting them from the GitHub source repository) and making them into a new plugin with your own name. As an example, rather than extend the Camera API and make changes to Camera.m and recompile etc... I chose to make a plugin unoriginally called MyCamera that had the code from the Camera API and my own extensions. Most of the APIs in PhoneGap (at least in iOS) are basically already plugins in their own right, so they don't need much tweaking to be turned into a plugin just for your purposes.
This method also means you can upgrade PhoneGap later and not clobber all your extensions.

Linking libcsoap to iPhone project in Xcode

I have an iPhone project that I want to use libcsoap in to make service calls. I'm having trouble linking a pure c library to xCode though. I've tried everything short of manually rebuilding the project as an Xcode project.
I built it via command line (./configure; make; make install). Then linked the output (libcsoap.a) and connected to the headers. This gave me a linker error saying that libcsoap.a was built for archiving and couldn't be used.
I tried creating a project out of just the makefile but that failed to build.
Can anybody explain to me what I should do to link these?
Thanks in advance,
George

XCode Project Libraries and Version Control

I've just discovered, via the Objective Flickr API, that you can add projects into xcode as secondary libraries for your own project. It's very nifty, and it's finally let me get on top of the Flickr stuff I wanted to do.
Problemo! I need to bung this stuff into version control. Presumably the .proj file is what keeps a record of these references and libraries? Is that what I need to commit to make sure other people working on this project get the libraries? Additionally, in the past, committing the .proj file has conflicted very badly with other people. Is there a good way of doing it? Should it be done at all?
If you mean the .xcodeproj file, then yes, you should commit that to version control. It'll contain all the file references and settings that someone else needs to compile the project.