objective-c 错误 '_BSMachError: 端口 1607; (os/kern) 无效功能 (0x14) 在 iOS 10 上的 Cordova 应用程序中“无法插入 COPY_SEND”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39676762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 21:38:41  来源:igfitidea点击:

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

objective-ccordovaios10xcode8

提问by umesh

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 Portraitto Landscapewhere as it still working fine on iOS 9.3.1. In debugger i'm getting following logs:

一切正常,直到我使用 Xcode 7.3.0 构建我的cordova 应用程序,但在使用 Xcode 8 构建相同的应用程序后,每当我将方向从纵向更改为横向时,它仅在 iOS 10 设备上开始崩溃,因为它在 iOS 上仍然可以正常工作9.3.1. 在调试器中,我收到以下日志:

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
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

警告:无法从 dyld 共享缓存加载任何 Objective-C 类信息。这将显着降低可用类型信息的质量。

* 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
  • Xcode 8
  • 科尔多瓦 6.3.0 (iOS 4.1.0)
  • iOS 10 iPhone 6

Please help.

请帮忙。

回答by Craig Pickering

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.

我在调试器中收到“无效能力 (0x14)”“无法插入 COPY_SEND”消息,这会阻止应用程序启动大约 10 秒。

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.

我删除了所有断点,从那以后就没有看到错误消息。

回答by Neimsz

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

我在 iOS10.0 beta 阶段遇到了同样的问题,它似乎仍然存在于 Xcode v11 中。

There are actually 2 separate errors :

实际上有 2 个单独的错误:



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.

1.首先,正如 Avaan 所评论的,您必须在 info.plist 中设置所有隐私使用。我相信这是你崩溃的原因。

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

从 iOS10.0 开始,必须明确告诉用户您将使用手机的哪些功能,以及出于何种原因。

Project Info

项目信息



2.Regarding the error :

2.关于错误:

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

BSMachError: 端口 1607; (os/kern) 无效能力 (0x14)“无法插入 COPY_SEND”

I resolved the error with this little workaround :

我用这个小小的解决方法解决了这个错误:

  1. Go in Project Settings/General -> Deployment info, check all orientations.
  1. 进入项目设置/常规 -> 部署信息,检查所有方向。

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.
  1. 构建并运行,界面应根据设备方向旋转。
  2. 撤消您刚刚执行的操作(取消选中您不需要的方向)。再次构建并运行,错误不应再出现。

I hope this helped

我希望这有帮助

回答by okat

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:

我在重置核心数据时收到了这个错误,但上述解决方案都没有奏效或与我的情况相关。结果是代码在 UIAlert 的动作中发生,需要被推入主线程。通过此处找到的解决方案 -错误 _BSMachError: (os/kern) invalid capacity (20) after receive remote notice after CloudKit record 添加- 并在下面针对 Swift 4 进行了更新:

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

回答by Peter B. Kramer

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

对我来说,原因是[myTextField becomeFirstResponder];放置在初始 viewWillAppear 线程结束之后。

回答by mxlhz

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

我突然在使用 iPhone 11 pro 模拟器时遇到了这个错误,而它在其他地方(其他模拟器和实际设备)都运行良好。

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.

希望它可以帮助其他人在同一情况下。

回答by mark

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.

我收到此错误,尝试了此线程中的所有解决方案,但没有任何效果。我修复了一个看似无关的 UIColor(颜色超出范围)错误,并且这个 COPY_SEND 问题也消失了。

The specific UIColor error was UIColorBreakForOutOfRangeColorComponents.

特定的 UIColor 错误是 UIColorBreakForOutOfRangeColorComponents。

回答by lucygenik

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.

我在添加没有匹配字符串的 Info.plist 键时得到了这个。在我的实例中,我添加了 NSLocationAlwaysAndWhenInUseUsageDescription 没有描述。访问权限对话框会导致发生此错误。添加字符串值解决了该问题。IOS11.

回答by Sangram Shivankar

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

事实证明 - 如果您调用 EventKit、ContactsKit、麦克风、相机等需要权限而没有 Info.plist 键(例如
Privacy - Location When In Use Usage Description
Privacy - Media Library Usage Description),应用程序将会崩溃

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

我从https://forums.developer.apple.com/thread/48959thread得到了这个答案

also, check whether you forgot to disable zombies.

另外,请检查您是否忘记禁用僵尸。

回答by Johan Tingbacke

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.

我有一个类似的问题(查看我在 SO 上的问题)并发现我的 UI 已经创建了另一个自己的实例,同时呈现两者。

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.

如果您还没有找到解决问题的方法,我建议您使用 Debug View Hierarchy-tool...也许您遇到了和我一样的问题。

Good luck!

祝你好运!

回答by pegpeg

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

对我来说是我的 plist 上的翻译。仔细检查您的 plist 是否已本地化,是否翻译了正确的隐私文本。

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

花了我几个小时才找到它...我一直遇到 SFSafariView 布局问题。