abhayjoshiglb / air-maps-ane

Automatically exported from code.google.com/p/air-maps-ane
0 stars 0 forks source link

Re-compile for develop #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey there!
So i am trying to add some new features to the code you already made.
I started by trying to re-compile your code and get it working.
My problem is this:
- i built the swc
- i compiled the .a file
- i build the ane
-> when i try to compile the ipa , i get this errors:
Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_MKUserLocation", referenced from:
      objc-class-ref in libcom.sampleNativeExtensions.Maps.a(MapNENativeMain.o)
  "_OBJC_CLASS_$_MKPinAnnotationView", referenced from:
      objc-class-ref in libcom.sampleNativeExtensions.Maps.a(MapNENativeMain.o)
  "_OBJC_CLASS_$_MKMapView", referenced from:
      objc-class-ref in libcom.sampleNativeExtensions.Maps.a(MapNENativeMain.o)
ld: symbol(s) not found for architecture armv7

I am pretty sure the problem is with the .a file resulted from Xcode
Because i tried compiling the ipa with my swc and your ane and it worked.
Any clues on what i could do to fix this ?

Thanks!

Original issue reported on code.google.com by ra...@prosjektlab.no on 6 Mar 2012 at 10:53

GoogleCodeExporter commented 9 years ago
also this is how my extension.xml looks like

<extension xmlns="http://ns.adobe.com/air/extension/3.1">
    <id>com.sampleNativeExtensions.Maps</id>
    <versionNumber>0.0.2</versionNumber>
    <platforms>
        <platform name="iPhone-ARM">
            <applicationDeployment>
                <nativeLibrary>libMapsNENative.a</nativeLibrary>
                <initializer>MapsExtensionExtInitializer</initializer>
                <finalizer>MapsExtensionExtFinalizer</finalizer>
            </applicationDeployment>
        </platform>
    </platforms>
</extension>

Original comment by rares.fxstudio@gmail.com on 6 Mar 2012 at 12:33

GoogleCodeExporter commented 9 years ago
Till AIR 3.0 many frameworks were already linked by default when we compiled 
the .ipa file. But since AIR 3.1, more functionality has been added in which 
you can specify any external framework to be linked. As a result few of the 
frameworks which were linked by default were removed from AIR sdk and MapKit 
framework was one among them.

You can read more about this at 
http://blogs.adobe.com/rajorshi/2011/11/16/ios5-support-for-airusing-external-sd
ks-to-package-apps/

So now to include this MapKit framework in the ipa file 2 changes are required :

1.) While packaging the .ane file
Create a new xml file which will contain all the information about the 
frameworks tha are going to be used. For maps it would look like this :

<platform xmlns="http://ns.adobe.com/air/extension/3.1">
    <sdkVersion>5.0</sdkVersion>
    <linkerOptions>
        <!-- to use the Twitter framework -->
        <option>-framework MapKit</option>
        <!-- to link with the libiconv.dylib -->
        <option>-liconv</option>
    </linkerOptions>
</platform>

ane packaging command :
adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform 
iPhone-ARM library.swf libmylib.a -platformoptions <ABOVE_XML_FILE>.xml

2.) While packaging the ipa
You need to specify the path of the ios sdk to link against. This is done by 
-platformsdk option 
example command :

adt -package -target ipa-app-store -provisioning-profile 
./myProfile.mobileprovision -storetype pkcs12 -keystore ./Certificates.p12 
-storepass XXX myApp.ipa myApp-app.xml Main.swf -extdir ext/ -platformsdk 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/

In FB 4.6 there is dialog in project properties and you can browse to the sdk 
location from UI.

Let me know if you face any more issues.

Original comment by shahme...@gmail.com on 6 Mar 2012 at 3:37

GoogleCodeExporter commented 9 years ago
Hey! 
Thank you for your response! It helped a lot, i FINALLY moved over this problem.
So i added the  -platformoptions xml file, and indeed the file compiled without 
the previous errors.
I compiled it for debug mode and installed it on my ipad.
Started debugger in flash professional, the app connected, did a trace i had in 
the app, then closed the debugger, and remained in that state. if i tried to 
open the debugger again, i would get the same thing, trace, then debugger 
closed.

Have you experienced this ?

Original comment by rares.fxstudio@gmail.com on 6 Mar 2012 at 5:26

GoogleCodeExporter commented 9 years ago
>>Started debugger in flash professional, the app connected, did a trace i had 
in the app, then closed the debugger, and remained in that state. if i tried to 
open the debugger again, i would get the same thing, trace, then debugger 
closed.

the debugger closed - means did you closed it or it happened on its own ?
Seems like the debugger is getting disconnected. Was the app still running 
after the debugger was closed ?

Never seen this before.

While developing I used trace statements in AS code and NSLog statements in 
obj-c code to keep track of the flow of execution.

Original comment by shahme...@gmail.com on 6 Mar 2012 at 5:38

GoogleCodeExporter commented 9 years ago
Yeah, the debugger closed on it's own, and the app was still running and 
re-trying to connect to debugger,so when i opened the debugger again, it opened 
and closed again.
I do have 6 warnings in the xcode project, do you think that might be why? or 
you get the warnings also ?

Original comment by rares.fxstudio@gmail.com on 6 Mar 2012 at 5:42

GoogleCodeExporter commented 9 years ago
I guess the warnings are harmless. Let me know if they are anything other from 
NSString format warnings.

Debugger getting disconnected might be a different issue(Mac firewall issue may 
be). You can see if that happens with another simple project without native 
extensions.

Original comment by shahme...@gmail.com on 6 Mar 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Unfortunately i have the same problems as yesterday. The app launches, connects 
to debugger, does a trace i have in the fla file, then "debug session 
terminated". The app screen remains black and it stays running and tries to 
connect again if i were to start the debugger again.
I am debugging this on windows, same as i do with all my apps, and i am sure 
it's not a firewall thing. It has something to do with the ane (.a) file i 
create, because if i use the my swc and your ane it works :)

Original comment by rares.fxstudio@gmail.com on 7 Mar 2012 at 7:49

GoogleCodeExporter commented 9 years ago
Hey man, i found the issue. When i was compiling the swf from flash i had the 
com folder used to build the swc, and it was interfering with something.
At the current moment i have a map that is 100% compiled and working on my 
machine, swc and ane file.

Now, lets have some fun with XCode :D

Original comment by rares.fxstudio@gmail.com on 7 Mar 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Good to hear that its working now !!!
Yeah. Now the fun part begins...

Original comment by shahme...@gmail.com on 8 Mar 2012 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by shahme...@gmail.com on 25 Aug 2012 at 5:48