Cannot find lib when packaging for iOS
===

*for numbers in (), see links at the end*

I am developping an Air Native Extension (ANE) in order to be able to use the burstly ads on mobile devices.

As for my setup, I am using the FlashDevelop 4.0.4 and Adobe Air 3.3. I'm using Flex 4.6.0 SDK. The project is setup on Windows7.

In order to work on iOS devices, Burstly requires a number of frameworks and librares

I managed to write and compile the .a library for iOS. I also have the interface (actionscript code) that will be shared for Android and iOS compiled into a swc and a librairy.swf. All of this is successfully packaged into a .ane which is included in my project.

When compiling a .a library on MacOS, all the framework and library used don't seems to be packaged in the ".a". This is why I had to use Air 3.3, for the -platformsdk option(1).

Since I work on Windows, I followed the instruction in this post to get the iOS SDK (2).

Following the required framework and (1), I made a platformConfig.xml file like this, which is packaged in the .ane

    <platform xmlns="http://ns.adobe.com/air/extension/3.1">
        <sdkVersion>4.2</sdkVersion>
        <linkerOptions>
            <!-- to use the AssetsLibrary framework -->
            <option>-framework AssetsLibrary</option>
		    <option>-framework AudioToolbox</option>
		    <option>-framework AddressBook</option>
		    <option>-framework AVFoundation</option>
		    <option>-framework CFNetwork</option>
		    <option>-framework CoreLocation</option>
		    <option>-framework MapKit</option>
		    <option>-framework MediaPlayer</option>
		    <option>-framework MessageUI</option>
		    <option>-framework OpenAL</option>
		    <option>-framework OpenGLES</option>
		    <option>-framework QuartzCore</option>
		    <option>-framework StoreKit</option>
		    <option>-framework SystemConfiguration</option>
		    <option>-framework Foundation</option>
		    <option>-framework CoreGraphics</option>
		    <option>-libsqlite3</option>
		    <option>-libxml2</option>
		    <option>-libz</option>
        </linkerOptions>
    </platform>

and this is the line to compile the actuale .ane

    call "%FLEX_SDK%\bin\adt" -package -target ane ../release/burstlyadsextension.ane extension.xml -swc burstlyAds.swc -platform iPhone-ARM library.swf libBurstlyAds.a -platformoptions platformConfig.xml

Problem arises when I try to package the iOS app with ADT:

    call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR% -extdir lib/external/ -platformsdk ../Libraries/iPhoneOS5.0.sdk/

this happens:

"ld: library not found for -libsqlite3
Compilation failed while executing : ld64"

frameworks seems to be added fine, but the dylib are not. I tried to add the line:

    <option>-L usr/lib/</option>

before including the lib, but I got this error instead:

"ld: warning: directory not found for option '-Lusr/lib/'
ld: library not found for -libsqlite3
Compilation failed while executing : ld64"

I tried to use the full path, other relative path, but no matter what path I put in the option, I always get a "warning: directory not found for option". Even "<option>-L ../</option>" give me this warning. The only thing that seems to work is "<option>-L /../</option>", but my .dylib obviousle are not there.

So my questions are: What did I do wrong? Any idead what else I could try? Even an explanation as to why it is not working would be helpful!

Links:
#1: http://blogs.adobe.com/rajorshi/2011/11/16/ios5-support-for-airusing-external-sdks-to-package-apps/
#2: http://blogs.adobe.com/airodynamics/2012/05/18/using-platformsdk-for-ios-on-windows/