You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2013/04/19 02:15:16 UTC

[jira] [Commented] (CB-2718) .a files cannot be installed properly, it needs to be in "Build Phases/Link Binary with Libraries"

    [ https://issues.apache.org/jira/browse/CB-2718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635881#comment-13635881 ] 

Shazron Abdullah commented on CB-2718:
--------------------------------------

Another situation is for .framework files. For example the FacebookConnect plugin: https://github.com/phonegap/phonegap-facebook-plugin/tree/plugman-FB-SDK-3.2.1

Right now the plugin includes all source .m and .h files, but the downloadable Facebook SDK (per the manual install instructions) is in pre-compiled .framework form. The FacebookConnect plugin would need to include the .framework to avoid this situation where the user needs to change the import header of the plugin: https://github.com/phonegap/phonegap-facebook-plugin/issues/267
                
>  .a files cannot be installed properly, it needs to be in "Build Phases/Link Binary with Libraries"
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CB-2718
>                 URL: https://issues.apache.org/jira/browse/CB-2718
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS, Plugman
>    Affects Versions: Master
>            Reporter: Shazron Abdullah
>            Assignee: Anis Kadri
>
> plugin.xml:
> https://github.com/shazron/TestFlightPlugin/blob/b55cd6e7f11a599223645511cb0c6e9741648b9b/plugin.xml#L37
> As you can see, the .a file is installed as a *source-file*, which is needed for the file to be copied into the *Plugins* folder. The file is also added to the *Build Phases/Compile Sources* phase when it shouldn't be - but this is harmless.
> The .a file needs to be installed into the *Build Phases/Link Binary with Libraries*, if not there is a linker error. To do this, you could specify the file as a *framework* tag, setting the *src* attribute. However, no matter what you do, you can't get the right path since the framework item is set to "Relative to Group" in Xcode, and this is set to the root of the project folder. 
> So if the project folder is "/Users/Desktop/FooProject", that is the root of the *Frameworks* group as well. The *Plugins* folder would be in "/Users/Desktop/FooProject/FooProject/Plugins", and there is no way to know this ahead of time (note the extra FooProject), if not, I could set the framework *src* attribute to "FooProject/Plugins/blah" (but this is not ideal, and is confusing)
> !https://f.cloud.github.com/assets/36107/261545/7a0b933c-8cf8-11e2-8cd7-446a0b62c582.jpg|width=640!
> Not sure how to fix this but some suggestions:
> 1. plugman appends the "FooProject/Plugins" part to the src (only for a user lib), so this configuration could work:
> {code}
> <source-file src="TestFlight1.1/libTestFlight.a" target-dir="TestFlightPlugin/TestFlight1.1" />
> <framework src="TestFlightPlugin/TestFlight1.1/libTestFlight.a" />
> {code}
> This would work a bit better if CB-2717 was implemented.
> 2. Or better yet, have a *framework=[boolean]* attribute on a *source-file* element:
> {code}
> <source-file src="TestFlight1.1/libTestFlight.a" target-dir="TestFlightPlugin/TestFlight1.1" framework="true"/>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira