Cocaopods in combination with framework


I am trying to load two different types of frameworks into our current project. One is using a CocoaPod and the other is being copied manually into the resource folder.

Once the manual copy framework is integrated into the project. I can no longer run the framework that is included using CocoaPods. I get a reference error saying that the runtime objects for the cocoapod framework do not exist.

in this case the error message is:
The bundle “PersistenceTesting” couldn’t be loaded because its executable couldn’t be located.

Has anyone else encountered a similar or the same issue before?

Demo repo =>


Try doing:
tns platform remove ios
pod repo update

And then try building again.



I did the pod repo update command and have built again. But this has not yielded a different result.


Hey, so when I downloaded your repo yesterday these are some of the issues I encountered:

  1. The TypeScript for npm i was invalid at “2.1.0”, so I made it “~2.1.0”

  2. Next I had some failures for the use of the iOS native methods so I added the stuff for the tns-platform-declarations to get it to compile.

  3. After that I had no build errors, but when I ran the app it gave a general “segfault” error and exited, but my guess this was to do with the custom delegate and since it built I didn’t dig further.

It looks like you have fixed the first error since then, and just set “noEmitOnError”: true to get around the second.

When I downloaded the repo fresh today I didn’t get the NPM error since you now had the version set to "^2.1.0".

Just for the sake of completeness today here are my results:
For the second issue this is how you should resolve it as detailed here:

npm i tns-platform-declarations -D


    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
        "lib": [
        "skipLibCheck": true
    "exclude": [


// Comment out the default line and add the 3 new lines
// /// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" /> Needed for autocompletion and compilation.

/// <reference path="./node_modules/tns-core-modules/tns-core-modules.es2016.d.ts" />

/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

The build output made no mention of “PersistenceTesting”, so in an attempt to sort of force the error I added this to the end of app/App_Resources/iOS/build.xcconfig:
OTHER_LDFLAGS = $(inherited) -framework "PersistenceTesting"
When I ran the build I then got:

ld: warning: directory not found for option '-F/Users/…/Library/Developer/Xcode/DerivedData/nativescriptframeworkissuedemo-bdghgaqehffbuqgdwnlajxitttvl/Build/Products/Debug-iphonesimulator/UrbanAirship-iOS-SDK’
ld: framework not found PersistenceTesting
clang: error: linker command failed with exit code 1 (use -v to see invocation)


The following build commands failed:
Ld /Users/…/Library/Developer/Xcode/DerivedData/nativescriptframeworkissuedemo-bdghgaqehffbuqgdwnlajxitttvl/Build/Intermediates/ normal x86_64
Ld /Users/…/Library/Developer/Xcode/DerivedData/nativescriptframeworkissuedemo-bdghgaqehffbuqgdwnlajxitttvl/Build/Intermediates/ normal i386
(2 failures)
Command xcodebuild failed with exit code 65

Which seems similar to the error you are mentioning. My guess is that an earlier version of Urban Airship included this “PersistenceTesting” in a different way than it does now.

Without digging into the code to deeply I changed main.ts to:

// this import should be first in order to load some required settings (like globals and reflect-metadata)
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { AppModule } from "./app.module";
import { isIOS } from 'platform';
import { CustomDelegate } from './custom.delegate';
import application = require('application');

import { NsUrbanairship } from 'nativescript-urban-airship';



Which resulted in:

CONSOLE LOG file:///app/tns_modules/@angular/core/bundles/core.umd.js:111:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
[E] __52+[UAirship handleAppDidFinishLaunchingNotification:]_block_invoke [Line 295] [UAirship takeOff] was not called in application:didFinishLaunchingWithOptions:
[E] __52+[UAirship handleAppDidFinishLaunchingNotification:]_block_invoke [Line 296] Please ensure that [UAirship takeOff] is called synchronously before application:didFinishLaunchingWithOptions: returns

Which means that Urban Airship is being built correctly, but the segfault you are seeing is likely do to the way you’re using it (might be missing some required configuration value or something about the way the custom delegate is setup)

My guess is that there is something cached on your system that is causing this build issue, since I can’t reproduce it specifically, but have had similar troubles in the past for the same reasons, the best I can suggest is:

rm -rf hooks lib platforms node_modules
pod cache clean
pod repo update

I would check your npm -g outdated for your global packages. Make sure you’re up-to-date for nativescript.

If the issue is still occuring, then I would say to include the platforms/ directory in your github. At very least, I suspect the issue may be when platforms/ios/plugins-debug.xcconfig is being generated. Should look something like:

LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
 OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/UrbanAirship-iOS-SDK/AirshipKit.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AirshipKit"



Thanks for taking the time and look into this.
I have had some time to add these cleanups. Since it was just for the demo I did not include many of the needed references and typescript types. I have added them now since it does make debugging much easier, thank you for that.

I have added the platforms folder as well. What is being generated is identical to yours.
My node version is 7.5.0 (also tested on 6.9.1)
and tns version is 2.5.2 (also tested on 2.5.0)

Just updated my cocoapods as well to see if the issue laid there.

For Lifecycle purposes I am calling the UA takeoff method in the custom delegate applicationDidFinishLaunchingWithOptions function. But I agree that it’s a combination of the usage of custom delegate and UA that seem to be causing the issue.


I have also been looking into this issue, and it’s definitely perplexing. Here are some simple steps to recreate it.

Create a new NativeScript app (I’m just using the base tutorial one):

tns create TestApp --template nativescript-template-ng-tutorial

Once that is done, add the Urban Airship plugin:

tns plugin add nativescript-urban-airship

Set it up as specified here:
(I sent TJ sample settings so you will not need to setup a demo account for this to work)

Initialization code added in main.ts (before the bootstrapModule call):

import { PushNotification } from ‘./push-notification’;

Run the application, the application runs, the urban airship native “takeoff” is called, you will see output similar to (truncated):

[D] -[UALegacyAPNSRegistration updateRegistrationWithOptions:categories:completionHandler:] [Line 57] Already unregistered for user
notification types.
[I] __56-[UAInboxMessageList refreshInboxWithCompletionHandler:]_block_invoke_2 [Line 384] Inbox messages updated.
[D] __56-[UAInboxMessageList refreshInboxWithCompletionHandler:]_block_invoke_2 [Line 386] Loaded saved messages: (
[D] __59-[UAInboxAPIClient retrieveMessageListOnSuccess:onFailure:]_block_invoke_2 [Line 181] Setting Last-Modified time to ‘(null)
’ for user z2QdN-JNR9-KT1WeyOB4sg’s message list.
[D] __75-[UAInboxMessageList retrieveMessageListWithSuccessBlock:withFailureBlock:]_block_invoke.73 [Line 161] Refreshing message l
[I] __56-[UAInboxMessageList refreshInboxWithCompletionHandler:]_block_invoke_2 [Line 384] Inbox messages updated.
[D] __56-[UAInboxMessageList refreshInboxWithCompletionHandler:]_block_invoke_2 [Line 386] Loaded saved messages: (

Next add the plugin for live engage:

tns plugin add nativescript-live-engage

Now when the application is run, it will error out with the Segmentation Fault.

I have also created a new project, and installed only the nativescript-live-engage plugin, and it ran successfully (I didn’t initialize anything with the plugin in the code itself).


@cpayette I confirmed the problem this morning. Here’s the full error:

Mar 23 08:33:05 VANTOLLMAC[1625] (UIKitApplication:org.nativescript.TestApp[0xda80][3732]): Service exited due to Segmentation fault: 11

What’s interesting is that each of these plugins work fine individually, but the combination is problematic. And most importantly, whatever error you’re getting seems to be completely swallowed. I’m not seeing any further details in the system log. I’m going to follow up here.


@tjvantoll If you check the Xcode debugger it might shed some more information on whats happening.


I was able to get a lot more debug information by commenting out the Urban Airship initialization code and allowing the LPMessagingSDK to try and initialize without UA, which resulted in this very helpful stacktrace:

[2017-03-23 09:35:47.018] [0x7fd4d5129550] [INFO]: [GlobalTransportManager] [registerReachability()] [L69]: Reachable via WiFi
[2017-03-23 09:35:47.018] [0x7fd4d2e03cb0] [TRACE]: [CSDSManager] [getCSDSDomain(:serviceName:isQA:completion:failure:)] [L35]: Trying to get CSDS Domain for: loggos
[2017-03-23 09:35:47.027] [0x7fd4d2e03cb0] [DEBUG]: [CSDSManager] [getCSDSDomain(
:serviceName:isQA:completion:failure:)] [L57]: Requesting CSDS with url:
[2017-03-23 09:35:47.029] [0x7fd4d5129550] [TRACE]: [HTTPRequestOperation] [start()] [L26]: HTTPRequestOperation: start, with url:
[2017-03-23 09:35:47.029] [0x7fd4d2e03cb0] [TRACE]: [LPMessagingSDK] [initialize] [L79]: ----------------------- SDK Initialized ---------------------------------
[2017-03-23 09:35:47.030] [0x7fd4d2e03cb0] [INFO]: [LPMessagingSDK] [initialize] [L80]: LPMessagingSDK version: nil
[2017-03-23 09:35:47.034] [0x7fd4d2e03cb0] [ERROR]: [DataManager] [handleKeychainPersistency()] [L56]: FAILED TO REMOVED ALL OBJECTS FROM KEYCHAIN FOR FIRST INSTALLATION!!
[2017-03-23 09:35:47.055] [0x7fd4d2e03cb0] [DEBUG]: [DataManager] [createPersistentStoreCoordinator()] [L283]: Creating PersistentStoreCoordinator at url: file:///Users/nathan/Library/Developer/CoreSimulator/Devices/50661F53-A3AF-4858-AB9E-DFD7D9F88746/data/Containers/Data/Application/F3D11CC4-E411-46B6-BA49-B0BBC23E768F/Documents/Consumer.sqlite
[2017-03-23 09:35:47.109] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L181]: SDK Crashed with exception:
Optional(“NSFetchRequest could not locate an NSEntityDescription for entity name ‘LPBrandEntity’”)
[2017-03-23 09:35:47.109] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L182]: Crash stack trace:
[2017-03-23 09:35:47.109] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 0 CoreFoundation 0x0000000112ee6d85 __exceptionPreprocess + 165
[2017-03-23 09:35:47.110] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 1 libobjc.A.dylib 0x000000011295adeb objc_exception_throw + 48
[2017-03-23 09:35:47.111] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 2 CoreData 0x000000011380abda -[NSFetchRequest(_NSInternalMethods) _resolveEntityWithContext:] + 426
[2017-03-23 09:35:47.114] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 3 CoreData 0x00000001138097c6 -[NSManagedObjectContext executeFetchRequest:error:] + 150
[2017-03-23 09:35:47.115] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 4 LPInfra 0x00000001123cf634 _TTSf4n_g_g_n___TTSg5C7LPInfra12LPUserEntity___TFC7LPInfra11DataManager13queryEntitiesuRxCSo15NSManagedObjectrfTMx9predicateGSqCSo11NSPredicate_7contextGSqCSo22NSManagedObjectContext__GSax__merged + 436
[2017-03-23 09:35:47.115] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 5 LPInfra 0x00000001123cf7e2 TTSf4n_g_g_n___TTSg5C7LPInfra13LPBrandEntity___TFC7LPInfra11DataManager13queryEntitiesuRxCSo15NSManagedObjectrfTMx9predicateGSqCSo11NSPredicate_7contextGSqCSo22NSManagedObjectContext__GSax + 50
[2017-03-23 09:35:47.118] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 6 LPInfra 0x0000000112413897 TFC7LPInfra12BrandManagercfT_S0 + 359
[2017-03-23 09:35:47.118] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 7 LPInfra 0x0000000112410ad3 globalinit_33_0A89D6C7AC854A666AF09B733D7F8A87_func179 + 35
[2017-03-23 09:35:47.119] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 8 libdispatch.dylib 0x0000000113e3a3d7 _dispatch_client_callout + 8
[2017-03-23 09:35:47.120] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 9 libdispatch.dylib 0x0000000113e27bab dispatch_once_f + 76
[2017-03-23 09:35:47.120] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 10 LPInfra 0x00000001123931e4 _TTSf4d___TZFC7LPInfra13LPInfraFacade15initializeInfrafT_Sb + 324
[2017-03-23 09:35:47.121] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 11 LPMessagingSDK 0x000000011276d4c8 TFC14LPMessagingSDK14LPMessagingSDK10initializefzGSqSS_T + 1128
[2017-03-23 09:35:47.121] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 12 LPMessagingSDK 0x000000011276d859 TToFC14LPMessagingSDK14LPMessagingSDK10initializefzGSqSS_T + 105
[2017-03-23 09:35:47.121] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 13 NativeScript 0x000000010f85b97d ffi_call_unix64 + 85
[2017-03-23 09:35:47.122] [0x7fd4d2e03cb0] [ERROR]: [LPMessagingSDK] [addGlobalExecpetionHandler()] [L184]: 14 ??? 0x0000000129ff79c0 0x0 + 4999576000
*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘NSFetchRequest could not locate an NSEntityDescription for entity name ‘LPBrandEntity’’

Which appears to suggest you need an NSEntityDescription, however this is likely due to fact that Keychain Sharing is not enabled as is required by the LPMessagingSDK, see the official readme here: --take note of the second bullet - you can refer to this for more info on how to do that:


Thank you for your feedback! Tomorrow I will update the demo project with fixes for adding the live engage bundle to the target and Keychain entitlements.

I really hope this will fix our problem.


I updated the project with the fixes. It solves the problem which @wwwalkerrun mentioned, but now the The bundle “PersistenceTesting” error is back :cry:

The bundle “PersistenceTesting” couldn’t be loaded because its executable couldn’t be located.

Hope you can help us to solve this problem!


Did someone take a look at our problem already?


Hey all, make sure to see for a follow up from the NativeScript iOS runtime team.


awesome! The proposed solution solved the issue. We could never find & solve this problem on our own. Thank you all for the help!
Now we need to coordinate with live person to see how we can solve this issue.