Including Plugins

Hi,

I try to use the address book plugin in a Corona Enterprise project. I already read that I need to include it differently compared to the pro version, adding the actual plugin files to the project instated of just declaring it in build.settings.

I downloaded the plugin files and I got one file libnative-popup-addressbook.a but I am not sure where I should place it, declare it or include it in my project.

Some hints will be most thankful!

Ernest B.

On iOS, plugins are just static libraries.

There are lots of resources online about how to add static libraries. For example, I found this one with a quick google search: http://stackoverflow.com/questions/15973472/adding-static-library-inside-xcode-c-project

Following you reference, I added the .a library in Target->Build Phases->Link Binary With Libraries. Doing so caused the following build error:

ld: warning: directory not found for option '-L"/Users/ernest/Corona\_Enterprise/Architect/ios/CoronaEnterprise/Corona/ios/lib"' ld: library not found for -lplayer clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Worse of all deleting the recently added library does not solve the error so now I cannot build.

Please some help

snap1.jpg snap2.jpg

It can’t find the core Corona library. Where did you install the main CoronaEnterprise folder?

Try building an iOS sample that comes with CoronaEnterprise. If that has the same error, then something wrong happened to your install of /Applications/CoronaEnterprise. Easiest thing to do is reinstall.

Yes I can build sample projects, and I can also build other projects of my own. The CoronaEnterprise folder is in Applications. The error only takes place after adding the address book .a library in Target->Build Phases->Link Binary With Libraries and does not disappear by removing it. I also checked in Build Settings->Search Paths that the correct paths for the address book plugin had been added correctly automatically.

Is Adding the static library in Build Phases->Link Binary With Libraries the theoretically correct process in order to include a plugin on the enterprise?

It looks like Xcode messes up the Library Search Paths when you add a .a library to the project. In particular it adds weird quotations around the path to the CoronaEnterprise dir. 

Try the following:

  1. Copy the plugin .a library so it’s in the same folder as the .xcodeproj file

  2. Make sure your library search paths look like the attached. In particular, the 3 paths: 

    $(inherited) $(SRCROOT)/CoronaEnterprise/Corona/ios/lib .

The 3rd path tells xcode to look for .a files in the same dir as the .xcodeproj.

I just tried the above on a copy of the “App” project template, added the address book plugin, and things build correctly.

That solved my problem

Thanks Walter

On iOS, plugins are just static libraries.

There are lots of resources online about how to add static libraries. For example, I found this one with a quick google search: http://stackoverflow.com/questions/15973472/adding-static-library-inside-xcode-c-project

Following you reference, I added the .a library in Target->Build Phases->Link Binary With Libraries. Doing so caused the following build error:

ld: warning: directory not found for option '-L"/Users/ernest/Corona\_Enterprise/Architect/ios/CoronaEnterprise/Corona/ios/lib"' ld: library not found for -lplayer clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Worse of all deleting the recently added library does not solve the error so now I cannot build.

Please some help

snap1.jpg snap2.jpg

It can’t find the core Corona library. Where did you install the main CoronaEnterprise folder?

Try building an iOS sample that comes with CoronaEnterprise. If that has the same error, then something wrong happened to your install of /Applications/CoronaEnterprise. Easiest thing to do is reinstall.

Yes I can build sample projects, and I can also build other projects of my own. The CoronaEnterprise folder is in Applications. The error only takes place after adding the address book .a library in Target->Build Phases->Link Binary With Libraries and does not disappear by removing it. I also checked in Build Settings->Search Paths that the correct paths for the address book plugin had been added correctly automatically.

Is Adding the static library in Build Phases->Link Binary With Libraries the theoretically correct process in order to include a plugin on the enterprise?

It looks like Xcode messes up the Library Search Paths when you add a .a library to the project. In particular it adds weird quotations around the path to the CoronaEnterprise dir. 

Try the following:

  1. Copy the plugin .a library so it’s in the same folder as the .xcodeproj file

  2. Make sure your library search paths look like the attached. In particular, the 3 paths: 

    $(inherited) $(SRCROOT)/CoronaEnterprise/Corona/ios/lib .

The 3rd path tells xcode to look for .a files in the same dir as the .xcodeproj.

I just tried the above on a copy of the “App” project template, added the address book plugin, and things build correctly.

That solved my problem

Thanks Walter