iOS app not working after testing with 3rd party sdk

I am currently experiencing the exact same issue as this poster here:

https://forums.coronalabs.com/topic/29020-corona-sample-ios-app-not-building/

Basically I took the app template from Enterprise, tried to integrate a 3rd Party SDK, and added the libraries required for it based on its documentation. Then I got the following after building:

ld: warning: directory not found for option '-L/Users/username/Applications/CoronaEnterprise/ProjectTemplates/App/ios/CoronaEnterprise/Corona/ios/lib' ld: warning: directory not found for option '-F/Users/username/Applications/CoronaEnterprise/ProjectTemplates/App/ios/CoronaEnterprise/Plugins/sdk-facebook/ios' ld: library not found for -lplayer clang: error: linker command failed with exit code 1 (use -v to see invocation)

The SDK integrates well enough if used on a new project I start from scratch. And the unedited Corona app template naturally builds with no problem either. It’s only when I combine the two that I run into this issue.

Just some additional info in case it helps - I’m currently using Xcode 8.2.1, Corona Enterprise 2017.3023, and OS X 10.11.16

I was able to get rid of the first two warnings by removing the indicated paths from the framework and library search paths (although I’m not completely certain this is the right way to resolve this). But I am unable to find a proper fix for the last two lines of error. Does anyone know any possible solution for this?

Enterprise depends a lot on symbolic links. Normally you copy the App project to your own folder. Your libraries should be dragged into xcode making sure to choose the “Copy if needed” option. You can also hand copy them into the project as well, but they have to be added through Xcode to get them in the project.

It sounds like the process of adding the libraries is altering a path or something.  The “player” library is the Enterprise library. What are the instructions for adding the SDK?
 

Rob

Hi Rob,

Thanks for the response.

The instructions in integrating the SDK were pretty straightforward:

Drag SDK folder into Xcode project with “Copy items if needed” checked, add “-ObjC” in “Other Linker Flags” under Build Settings, then add the required frameworks under Build Phases.

The process does create a few additional search paths but they don’t cause any problems when used on a new project. Could they be in conflict with the paths provided in the Corona Enterprise sample projects?

It seems that issue in path with CoronaEnterprise location. Usually, we have symlink in root folder pointing to /Applications/CoronaEnterprise/ near ios project file. Then, in your main project (which linking is failing), set

Add to “Library Search Path” something like “$(SRCROOT)/CoronaEnterprise/Corona/ios/lib”. Note, SRCROOT variable pointing to location of iOS project. You can alternatively type full path to your Corona Enterprise, like “/Applications/CoronaEnterprise/Corona/ios/lib”

Hi vlads, thank you for the info. Yes I do still have that path even after including the new libraries. Anyway I tried removing and re-adding the SDK as well as the paths and some of its associated libraries and the build error disappeared now. Not sure which one is the culprit exactly but I’m getting a different error with “Command bh/sh failed with exit code 255” (attached screenshot below).

It says that Corona Builder’s signing failed to replace signature. I’ve tried deleting the derived data, rebooting, and cleaning the project, but the error still comes up. Any idea what I could be missing here?

Make sure to add: Other Linker Flags -all_load

and set Dead Code Stripping to “No”

Thanks, completely slipped my mind that I took out -all_load, which I originally did because it removed this error:

Undefined symbols for architecture x86\_64: "\_UnitySendMessage", referenced from: \_\_\_ACAdMediatorShowVideoCallback\_block\_invoke in libACAdMediator.a(ACAdMediatorX.o) ld: symbol(s) not found for architecture x86\_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there any library I should be looking out for with this one? I apologize for this last follow-up. This Appchair Ad mediator has been giving me quite a bit of trouble and couldn’t even get past their setup which has very little documentation and support.

Not a problem! But little bit trickier this way. You can load individual libraries. Try something like:

-force\_load /Applications/CoronaEnterprise/Corona/ios/lib/libplayer.a

Note, that if you’re using a plugin, you would have to add it’s force load too, for example:

-force\_load $(BUILT\_PRODUCTS\_DIR)/libplugin\_library.a

Well after trying out various solutions I still couldn’t get rid of the build error. I contacted the dev responsible for the SDK and they were able to provide updated versions of the files which thankfully allowed the project to build without any problems.

Thank you for all the helpful response though which at least let me fix a few other issues. Cheers.

I’m glad it worked out!

Enterprise depends a lot on symbolic links. Normally you copy the App project to your own folder. Your libraries should be dragged into xcode making sure to choose the “Copy if needed” option. You can also hand copy them into the project as well, but they have to be added through Xcode to get them in the project.

It sounds like the process of adding the libraries is altering a path or something.  The “player” library is the Enterprise library. What are the instructions for adding the SDK?
 

Rob

Hi Rob,

Thanks for the response.

The instructions in integrating the SDK were pretty straightforward:

Drag SDK folder into Xcode project with “Copy items if needed” checked, add “-ObjC” in “Other Linker Flags” under Build Settings, then add the required frameworks under Build Phases.

The process does create a few additional search paths but they don’t cause any problems when used on a new project. Could they be in conflict with the paths provided in the Corona Enterprise sample projects?

It seems that issue in path with CoronaEnterprise location. Usually, we have symlink in root folder pointing to /Applications/CoronaEnterprise/ near ios project file. Then, in your main project (which linking is failing), set

Add to “Library Search Path” something like “$(SRCROOT)/CoronaEnterprise/Corona/ios/lib”. Note, SRCROOT variable pointing to location of iOS project. You can alternatively type full path to your Corona Enterprise, like “/Applications/CoronaEnterprise/Corona/ios/lib”

Hi vlads, thank you for the info. Yes I do still have that path even after including the new libraries. Anyway I tried removing and re-adding the SDK as well as the paths and some of its associated libraries and the build error disappeared now. Not sure which one is the culprit exactly but I’m getting a different error with “Command bh/sh failed with exit code 255” (attached screenshot below).

It says that Corona Builder’s signing failed to replace signature. I’ve tried deleting the derived data, rebooting, and cleaning the project, but the error still comes up. Any idea what I could be missing here?

Make sure to add: Other Linker Flags -all_load

and set Dead Code Stripping to “No”

Thanks, completely slipped my mind that I took out -all_load, which I originally did because it removed this error:

Undefined symbols for architecture x86\_64: "\_UnitySendMessage", referenced from: \_\_\_ACAdMediatorShowVideoCallback\_block\_invoke in libACAdMediator.a(ACAdMediatorX.o) ld: symbol(s) not found for architecture x86\_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there any library I should be looking out for with this one? I apologize for this last follow-up. This Appchair Ad mediator has been giving me quite a bit of trouble and couldn’t even get past their setup which has very little documentation and support.

Not a problem! But little bit trickier this way. You can load individual libraries. Try something like:

-force\_load /Applications/CoronaEnterprise/Corona/ios/lib/libplayer.a

Note, that if you’re using a plugin, you would have to add it’s force load too, for example:

-force\_load $(BUILT\_PRODUCTS\_DIR)/libplugin\_library.a

Well after trying out various solutions I still couldn’t get rid of the build error. I contacted the dev responsible for the SDK and they were able to provide updated versions of the files which thankfully allowed the project to build without any problems.

Thank you for all the helpful response though which at least let me fix a few other issues. Cheers.

I’m glad it worked out!