Error '_BSMachError: port 1607; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND" in Cordova app on iOS 10

Everything works fine till I build my cordova application with Xcode 7.3.0 but it started crashing only on iOS 10 devices after building the same application with Xcode 8 whenever i'm changing the orientation from Portrait to Landscape where as it still working fine on iOS 9.3.1. In debugger i'm getting following logs:

2016-09-24 18:14:41.212470 MyApp[2542:1028606] [Common] _BSMachError: port 1607; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
2016-09-24 18:14:41.613460 MyApp[2542:1028606] [Common] _BSMachError: port 1607; (os/kern) invalid name (0xf) "Unable to insert COPY_SEND"
2016-09-24 18:14:41.613947 MyApp[2542:1028606] [Common] _BSMachError: port 1607; (os/kern) invalid name (0xf) "Unable to insert COPY_SEND"
2016-09-24 18:14:41.614469 MyApp[2542:1028606] [Common] _BSMachError: port 1607; (os/kern) invalid name (0xf) "Unable to deallocate send right"
Message from debugger: Terminated due to memory issue

Below is the stack trace

warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.

* thread #1: tid = 0xfc80c, 0x00000001000cff00 MyApp`-[MainViewController didReceiveMemoryWarning](self=0x0000000119e0da60, _cmd="didReceiveMemoryWarning") + 40 at MainViewController.m:59, stop reason = breakpoint 7.1


* frame #0: 0x00000001000cff00 MyApp`-[MainViewController didReceiveMemoryWarning](self=0x0000000119e0da60, _cmd="didReceiveMemoryWarning") + 40 at MainViewController.m:59
frame #1: 0x0000000192e29964 UIKit`+[UIViewController _traverseViewControllerHierarchyWithDelayedRelease:] + 432
frame #2: 0x0000000192d5a0f4 UIKit`-[UIApplication _performMemoryWarning] + 232
frame #3: 0x0000000192d5a294 UIKit`-[UIApplication _receivedMemoryNotification] + 140
frame #4: 0x0000000100a7d21c libdispatch.dylib`_dispatch_client_callout + 16
frame #5: 0x0000000100a893a8 libdispatch.dylib`_dispatch_continuation_pop + 708
frame #6: 0x0000000100a97fa8 libdispatch.dylib`_dispatch_source_latch_and_call + 204
frame #7: 0x0000000100a7f304 libdispatch.dylib`_dispatch_source_invoke + 836
frame #8: 0x0000000100a82060 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 652
frame #9: 0x000000018cc29f2c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
frame #10: 0x000000018cc27b18 CoreFoundation`__CFRunLoopRun + 1660
frame #11: 0x000000018cb56048 CoreFoundation`CFRunLoopRunSpecific + 444
frame #12: 0x000000018e5d9198 GraphicsServices`GSEventRunModal + 180
frame #13: 0x0000000192b2f818 UIKit`-[UIApplication _run] + 684
frame #14: 0x0000000192b2a550 UIKit`UIApplicationMain + 208
frame #15: 0x00000001000c7ecc MyApp`main(argc=1, argv=0x000000016fd3fab8) + 76 at main.m:32
frame #16: 0x000000018bb385b8 libdyld.dylib`start + 4

I'm running

  • Xcode 8
  • Cordova 6.3.0 (iOS 4.1.0)
  • iOS 10 iPhone 6

Please help.

94361 次浏览

Turns out - the app will crash if you call EventKit, ContactsKit, Microphone, Camera, etc that require permissions without Info.plist keys like
Privacy - Location When In Use Usage Description
Privacy - Media Library Usage Description

I got this answer from https://forums.developer.apple.com/thread/48959 thread

also, check whether you forgot to disable zombies.

I had a similar problem (check out my question on SO) and found out that my UI had created another instance of itself, presenting both at the same time.

If you have not found a solution to your problem yet I advice you to use the Debug View Hierarchy-tool... maybe you have got the same kind of problem as I had.

Good luck!

I ran into the same problem during iOS10.0 beta phases, and it seems to still be present in Xcode v11.

There are actually 2 separate errors :


1. First of all, as Avaan commented, you have to set all the privacy usage in the info.plist. I believe it is the cause of your crash.

Since iOS10.0, it is mandatory to explicitly tell the user what features of the phone you will use, and for what reasons.

Project Info


2. Regarding the error :

BSMachError: port 1607; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"

I resolved the error with this little workaround :

  1. Go in Project Settings/General -> Deployment info, check all orientations.

General settings

  1. Build and run, the interface should rotate according to the device orientation.
  2. Undo what you just did (uncheck orientations you don't need). Build and run again, the errors should not appear anymore.

我希望这能有所帮助。

I was getting the "invalid capability (0x14) "Unable to insert COPY_SEND" message in the debugger which would prevent the app from launching for about 10 seconds.

I had breakpoints set in files that I had since removed from the project but were still showing up in the Breakpoint navigator (file names in red).

I removed ALL breakpoints and haven't seen the error message since.

I got this when adding a Info.plist key without a matching string. In my instance I added NSLocationAlwaysAndWhenInUseUsageDescription without a description. Accessing the permission dialog cause this error to occur. Adding a string value resolved the issue. iOs11.

For me was the translations on my plist. Double check that if your plist is localized has the proper privacy texts translated.

Took me hours until found it... I Was getting a SFSafariView layout issue all the time.

I was getting this error, tried every solution in this thread, and nothing worked. I had a seemingly unrelated UIColor (color out of range) error that I fixed and this COPY_SEND issue went away, too.

The specific UIColor error was UIColorBreakForOutOfRangeColorComponents.

For me the cause was [myTextField becomeFirstResponder]; placed after the initial viewWillAppear thread ended.

I received precisely this error carrying out reset of Core Data but none of the above solutions worked or was relevant in my case. Turned out to be result of code taking place inside action of UIAlert which needed to be pushed into main thread. Solution found through here - Error _BSMachError: (os/kern) invalid capability (20) after receiving remote notification on CloudKit record addition - and updated below for Swift 4:

alert.addAction(UIAlertAction(title: "Reset Now", style: UIAlertAction.Style.default, handler: { action in
DispatchQueue.main.async {
// Core Data reset code goes here...
}
}))

I suddenly had this error using the iPhone 11 pro simulator while it was working fine everywhere else (other simulators and actual devices).

The solution for me was to reset the simulator by choosing Hardware > Erase All Content and Settings...

Hope it can help some others in the same case.

Xcode 11.5 introduced a new invalid capability: [textField resignFirstResponder] with the incomprehensible addition "Unable to insert COPY_SEND"

On a iPad with iOS 9.3.6:

2020-05-23 20:35:01.576 _BSMachError: (os/kern) invalid capability (20)
2020-05-23 20:35:01.580 _BSMachError: (os/kern) invalid name (15)

On a iPad with iPadOS 13.5:

2020-05-23 20:38:49 [Common] _BSMachError: port 12f0f; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"

On a iPhone with iOS 13.5:

2020-05-23 20:43:34 [Common] _BSMachError: port d503; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"

[textField resignFirstResponder] cannot be used anymore. See How to resign first responder from text field when user tap elsewhere? for alternatives.