- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 a working code-only approach 中的 MultiPeer 框架并将其移动到 into a MVVM structure 并得到以下异常。
我在两台不同的电脑上使用 Mac OS High Sierra,每台电脑都有 iPhone running my MVVM instance.
我仔细检查了纯代码方法,甚至在一个实例中使用了属性(而不是字段)。这似乎是 Xamarin 绑定(bind)或链接器问题。
NearbyDevicesViewController.cs/MCNearbyServiceAdvertiser - 损坏
public partial class NearbyDevicesViewController : UITableViewController
{
public string myPhoneName { get; set; }
public MCPeerID myPeerID { get; set; }
public const string SERVICE_STRING = "AELP";
public MCSession Session { get; set; }
List<PeerMonitorStatus> CachedPeerStatus = new List<PeerMonitorStatus>();
public NearbyDevicesViewController (IntPtr handle) : base (handle)
{
myPhoneName = "A" + UIKit.UIDevice.CurrentDevice.Name; // Adding A prefix incase numeric isn't allowed (it's a problem in Windows NETBIOS... so maybe also here?)
MyPhoneStatus.MyPeerID = myPhoneName;
myPeerID = new MCPeerID(myPhoneName);
Session = new MCSession(myPeerID);
Session.Delegate = new ChatSessionDelegate(Session);
//--------------------------------Advertiser----------------------------------------------------
var emptyDict = new NSDictionary();
AppDelegate.advertiser = new MCNearbyServiceAdvertiser(myPeerID, emptyDict, SERVICE_STRING);
AppDelegate.advertiser.Delegate = new MyNearbyAdvertiserDelegate(this);
System.Diagnostics.Debug.WriteLine("Starting advertising...");
AppDelegate.advertiser.StartAdvertisingPeer();
MyPhoneStatus.IsAdvertising = true;
////--------------------------------Browser------------------------------------------------------
//AppDelegate.browser = new MCNearbyServiceBrowser(myPeerID, SERVICE_STRING);
//AppDelegate.browser.Delegate = new MyBrowserDelegate(myPeerID, Session);
//System.Diagnostics.Debug.WriteLine("Starting browsing...");
//AppDelegate.browser.StartBrowsingForPeers();
//MyPhoneStatus.IsBrowsing = true;
CachedPeerStatus.AddRange(AppDelegate.PeerHistoryMonitor.Values);
}
public override nint RowsInSection(UITableView tableView, nint section)
{
return CachedPeerStatus.Count;
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
UITableViewCell cell = new UITableViewCell(CGRect.Empty);
var item = CachedPeerStatus[indexPath.Row];
cell.TextLabel.Text = item.DisplayText;
return cell;
}
}
AdvertiserController/MCNearbyServiceAdvertiser - 工作
public class AdvertiserController : DiscoveryViewController
{
MCNearbyServiceAdvertiser advertiser;
public AdvertiserController(string peerID) : base(peerID)
{
}
public override void DidReceiveMemoryWarning()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
View = new DiscoveryView("Advertiser", this);
var emptyDict = new NSDictionary();
Status("Starting advertising...");
advertiser = new MCNearbyServiceAdvertiser(PeerID, emptyDict, SERVICE_STRING);
advertiser.Delegate = new MyNearbyAdvertiserDelegate(this);
advertiser.StartAdvertisingPeer();
}
}
MyNearbyAdvertiserDelegate.cs - 已损坏
public class MyNearbyAdvertiserDelegate : MCNearbyServiceAdvertiserDelegate
{
MCSession session;
public MyNearbyAdvertiserDelegate(NearbyDevicesViewController session)
{
this.session = session.Session;
}
public override void DidReceiveInvitationFromPeer(MCNearbyServiceAdvertiser advertiser, MCPeerID peerID, NSData context, MCNearbyServiceAdvertiserInvitationHandler invitationHandler)
{
System.Diagnostics.Debug.WriteLine("Advertiser [" + session.MyPeerID.GetNativeHash() + "] will accept invite from " + peerID.DisplayName + " [" + peerID.GetNativeHash() + "]");
MyPhoneStatus.LastInvitation = DateTime.UtcNow;
MyPhoneStatus.ConnectedPeers.Clear();
MyPhoneStatus.ConnectedPeers.AddRange(session.ConnectedPeers);
invitationHandler(true, session);
}
}
MyNearbyAdvertiserDelegate - 工作
class MyNearbyAdvertiserDelegate : MCNearbyServiceAdvertiserDelegate
{
AdvertiserController parent;
public MyNearbyAdvertiserDelegate(AdvertiserController parent)
{
this.parent = parent;
}
public override void DidReceiveInvitationFromPeer(MCNearbyServiceAdvertiser advertiser, MCPeerID peerID, NSData context, MCNearbyServiceAdvertiserInvitationHandler invitationHandler)
{
parent.Status("Received Invite");
invitationHandler(true, parent.Session);
}
}
测试环境
我有两个 Mac+iPhone 硬件组合。无论哪台机器是广告商,都会出现此问题。如果代码作为服务器或浏览器运行,则需要在 NearbyDevicesViewController
中进行手动配置。
当服务器通过 MCNearbyServiceAdvertiserDelegate
收到邀请时,广告商崩溃,出现以下异常
Visual Studio 输出
Launched application 'net.agent7.AELP-MP' on '73' with pid 677
Loaded assembly: /private/var/containers/Bundle/Application/D2774A07-619E-44C5-9137-526686F6769C/AELPMP.app/Xamarin.iOS.dll [External]
Thread started: #2
Loaded assembly: /private/var/containers/Bundle/Application/D2774A07-619E-44C5-9137-526686F6769C/AELPMP.app/System.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/D2774A07-619E-44C5-9137-526686F6769C/AELPMP.app/AELPMP.exe
Resolved pending breakpoint at 'ChatSessionDelegate.cs:18,1' to void AELPMP.ChatSessionDelegate.DidChangeState (MultipeerConnectivity.MCSession session, MultipeerConnectivity.MCPeerID peerID, MultipeerConnectivity.MCSessionState state) [0x00001].
Resolved pending breakpoint at 'ChatSessionDelegate.cs:25,46' to void AELPMP.ChatSessionDelegate.DidChangeState (MultipeerConnectivity.MCSession session, MultipeerConnectivity.MCPeerID peerID, MultipeerConnectivity.MCSessionState state) [0x00069].
Resolved pending breakpoint at 'MyNearbyAdvertiserDelegate.cs:18,1' to void AELPMP.MyNearbyAdvertiserDelegate.DidReceiveInvitationFromPeer (MultipeerConnectivity.MCNearbyServiceAdvertiser advertiser, MultipeerConnectivity.MCPeerID peerID, Foundation.NSData context, MultipeerConnectivity.MCNearbyServiceAdvertiserInvitationHandler invitationHandler) [0x00000].
Resolved pending breakpoint at 'MyNearbyAdvertiserDelegate.cs:14,1' to void AELPMP.MyNearbyAdvertiserDelegate..ctor (AELPMP.NearbyDevicesViewController session) [0x00008].
Starting advertising...
2018-03-14 17:14:35.852 AELPMP[677:249758] critical: Stacktrace:
2018-03-14 17:14:35.852 AELPMP[677:249758] critical: at <unknown> <0xffffffff>
2018-03-14 17:14:35.853 AELPMP[677:249758] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-03-14 17:14:35.854 AELPMP[677:249758] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-03-14 17:14:35.855 AELPMP[677:249758] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-03-14 17:14:35.855 AELPMP[677:249758] critical: at AELPMP.Application.Main (string[]) [0x00001] in /Users/lamont/Downloads/AELPMP/Main.cs:12
2018-03-14 17:14:35.856 AELPMP[677:249758] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <0a8ff55fca4d4370bf8503724a39a15f#C25D3657-4A8E-C9A0-B325-6976392E2CBB>:0
2018-03-14 17:14:35.857 AELPMP[677:249758] critical:
Native stacktrace:
2018-03-14 17:14:35.891 AELPMP[677:249758] critical: 0 libmonosgen-2.0.dylib 0x0000000101200664 mono_handle_native_crash + 224
2018-03-14 17:14:35.892 AELPMP[677:249758] critical: 1 libmonosgen-2.0.dylib 0x000000010120d394 mono_sigsegv_signal_handler + 316
2018-03-14 17:14:35.892 AELPMP[677:249758] critical: 2 libsystem_platform.dylib 0x0000000185d73b50 _sigtramp + 52
2018-03-14 17:14:35.892 AELPMP[677:249758] critical: 3 libxamarin-debug.dylib 0x0000000101519f94 xamarin_get_block_wrapper_creator + 52
2018-03-14 17:14:35.892 AELPMP[677:249758] critical: 4 libxamarin-debug.dylib 0x000000010151dbd8 _ZL32get_method_block_wrapper_creatorP11_MonoMethodiPj + 260
2018-03-14 17:14:35.892 AELPMP[677:249758] critical: 5 libxamarin-debug.dylib 0x000000010151da04 xamarin_get_delegate_for_block_parameter + 64
2018-03-14 17:14:35.893 AELPMP[677:249758] critical: 6 AELPMP 0x0000000100ba55f0 _ZL30native_to_managed_trampoline_8P11objc_objectP13objc_selectorPP11_MonoMethodP25MCNearbyServiceAdvertiserP8MCPeerIDP6NSDataS0_j + 848
2018-03-14 17:14:35.893 AELPMP[677:249758] critical: 7 AELPMP 0x0000000100ba5294 -[AELPMP_MyNearbyAdvertiserDelegate advertiser:didReceiveInvitationFromPeer:withContext:invitationHandler:] + 80
2018-03-14 17:14:35.893 AELPMP[677:249758] critical: 8 MultipeerConnectivity 0x00000001a2080934 <redacted> + 180
2018-03-14 17:14:35.893 AELPMP[677:249758] critical: 9 libdispatch.dylib 0x0000000185acea54 <redacted> + 24
2018-03-14 17:14:35.893 AELPMP[677:249758] critical: 10 libdispatch.dylib 0x0000000185acea14 <redacted> + 16
2018-03-14 17:14:35.894 AELPMP[677:249758] critical: 11 libdispatch.dylib 0x0000000185adb698 <redacted> + 1016
2018-03-14 17:14:35.894 AELPMP[677:249758] critical: 12 CoreFoundation 0x00000001860f7344 <redacted> + 12
2018-03-14 17:14:35.894 AELPMP[677:249758] critical: 13 CoreFoundation 0x00000001860f4f20 <redacted> + 2012
2018-03-14 17:14:35.894 AELPMP[677:249758] critical: 14 CoreFoundation 0x0000000186014c58 CFRunLoopRunSpecific + 436
2018-03-14 17:14:35.895 AELPMP[677:249758] critical: 15 GraphicsServices 0x0000000187ec0f84 GSEventRunModal + 100
2018-03-14 17:14:35.895 AELPMP[677:249758] critical: 16 UIKit 0x000000018f76d5c4 UIApplicationMain + 236
2018-03-14 17:14:35.895 AELPMP[677:249758] critical: 17 libXamarin.iOS.dll.dylib 0x000000010112fce0 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 368
2018-03-14 17:14:35.895 AELPMP[677:249758] critical: 18 libXamarin.iOS.dll.dylib 0x000000010111a1bc UIKit_UIApplication_Main_string___intptr_intptr + 44
2018-03-14 17:14:35.896 AELPMP[677:249758] critical: 19 libXamarin.iOS.dll.dylib 0x000000010111a17c UIKit_UIApplication_Main_string___string_string + 172
2018-03-14 17:14:35.896 AELPMP[677:249758] critical: 20 libAELPMP.exe.dylib 0x0000000100bcbf80 AELPMP_Application_Main_string__ + 128
2018-03-14 17:14:35.896 AELPMP[677:249758] critical: 21 libmscorlib.dll.dylib 0x0000000100dcb8e8 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 248
2018-03-14 17:14:35.896 AELPMP[677:249758] critical: 22 libmonosgen-2.0.dylib 0x00000001012104e0 mono_jit_runtime_invoke + 968
2018-03-14 17:14:35.897 AELPMP[677:249758] critical: 23 libmonosgen-2.0.dylib 0x0000000101290620 do_runtime_invoke + 112
2018-03-14 17:14:35.897 AELPMP[677:249758] critical: 24 libmonosgen-2.0.dylib 0x00000001012939b0 do_exec_main_checked + 144
2018-03-14 17:14:35.897 AELPMP[677:249758] critical: 25 libmonosgen-2.0.dylib 0x00000001011f2274 mono_jit_exec + 268
2018-03-14 17:14:35.897 AELPMP[677:249758] critical: 26 libxamarin-debug.dylib 0x000000010152ccd0 xamarin_main + 2220
2018-03-14 17:14:35.897 AELPMP[677:249758] critical: 27 AELPMP 0x0000000100ba9958 main + 96
2018-03-14 17:14:35.898 AELPMP[677:249758] critical: 28 libdyld.dylib 0x0000000185b3456c <redacted> + 4
2018-03-14 17:14:35.898 AELPMP[677:249758] critical:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
XCode 输出这是我通过 Xcode 连接并查看设备日志时的输出
Incident Identifier: 791E1B33-A22E-4684-8ADF-0E4F601E01FC
CrashReporter Key: 8168b2a05f10e5f21da37250e7a61b844de00385
Hardware Model: iPhone9,1
Process: AELPMP [263]
Path: /private/var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/AELPMP
Identifier: net.agent7.AELP-MP
Version: 1.0 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: net.agent7.AELP-MP [413]
Date/Time: 2018-03-13 20:17:17.5692 -0400
Launch Time: 2018-03-13 20:17:17.4649 -0400
OS Version: iPhone OS 11.2.6 (15D100)
Baseband Version: 3.42.00
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Description: DYLD, Library not loaded: @rpath/libmonosgen-2.0.dylib | Referenced from: /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/AELPMP | Reason: no suitable image found. Did find: | /private/var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libmonosgen-2.0.dylib: required code signature missing for '/private/var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libmonosgen-2.0.dylib' |
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 Crashed:
0 dyld 0x000000010066ef48 __abort_with_payload + 8
1 dyld 0x000000010066e71c abort_with_payload_wrapper_internal + 100
2 dyld 0x000000010066e748 fcntl + 0
3 dyld 0x0000000100644498 dyld::fastBindLazySymbol+ 17560 (ImageLoader**, unsigned long) + 0
4 dyld 0x0000000100647714 dyld::_main+ 30484 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 7376
5 dyld 0x000000010064121c _dyld_start + 68
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000006 x1: 0x0000000000000005 x2: 0x000000016f92e4b0 x3: 0x000000000000008b
x4: 0x000000016f92e0b0 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x00000000000002e0
x8: 0x0000000000000020 x9: 0x0000000000000009 x10: 0x67736f6e6f6d6269 x11: 0x642e302e322d6e65
x12: 0x2f7070612e504d50 x13: 0x736f6e6f6d62696c x14: 0x2e302e322d6e6567 x15: 0x000a2762696c7964
x16: 0x0000000000000209 x17: 0x000000008000001f x18: 0xfffffff00f0dd260 x19: 0x0000000000000000
x20: 0x000000016f92e0b0 x21: 0x000000000000008b x22: 0x000000016f92e4b0 x23: 0x0000000000000005
x24: 0x0000000000000006 x25: 0x00000001004d0000 x26: 0x0000000100682000 x27: 0x0000000100681f88
x28: 0x000000016f92fab0 fp: 0x000000016f92e080 lr: 0x000000010066e71c
sp: 0x000000016f92e040 pc: 0x000000010066ef48 cpsr: 0x00000000
Binary Images:
0x1004d0000 - 0x1004dffff AELPMP arm64 <cf358776c3b038b6b2ba40f0fce56323> /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/AELPMP
0x100500000 - 0x10050ffff libAELPMP.exe.dylib arm64 <125e771584d2332084c3901961cd3b59> /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libAELPMP.exe.dylib
0x100524000 - 0x10052bfff libSystem.dll.dylib arm64 <e2f273739ebe391f961f97cb8573fdde> /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libSystem.dll.dylib
0x100640000 - 0x10067ffff dyld arm64 <477a8a1f098b3a80860d656a3f4918ea> /usr/lib/dyld
0x1006dc000 - 0x100857fff libmscorlib.dll.dylib arm64 <141d1723f765324bb687d89b93133a2b> /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libmscorlib.dll.dylib
0x100b38000 - 0x100b9bfff libXamarin.iOS.dll.dylib arm64 <c208d3645de53ba59a7ff7179ff584bb> /var/containers/Bundle/Application/99083856-91ED-46FF-A844-2E30F49014FF/AELPMP.app/libXamarin.iOS.dll.dylib
EOF
最佳答案
在类似情况下,我发现在再次构建之前删除输出文件夹并清理可以解决此问题。
右键单击解决方案并选择“删除输出文件夹”
关于c# - Xamarin:libmonosgen-2.0.dylib:MCNearbyServiceAdvertiser 上缺少所需的代码签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49288121/
我认为我弄乱了 libxml2.dylib、libz.dylib、libicucore.dylib 和 libc++.dylib 文件,然后 1. 在项目中显示为红色,2. 导致链接器错误。 并在与库
我正在研究 SDK,试图了解实际包含的内容。 我注意到 dylibs 有时会以多个版本发布,例如 ls /Applications/Xcode.app/Contents/Developer/Platf
我在评论中提出了这个问题,但这似乎是一个值得单独提问的问题。 我有一个项目在三个不同的 XCode 安装和两个不同的 iOS SDK 安装之间共享。目前,统一所涉及的开发人员不是一种选择。 当我安装
我正在多次加载 dylib 并尝试理解是什么让这些符号不同。 这是我的步骤: 使用以下入口点构建 lib_a.dylib: FactoryA : IFActory () {} extern "C" I
我正在关注 this tutorial 教程说明要添加 libz.1.2.3.dylib. 库,但是因为我下载了新的或旧的库(我不知道我的库是新的还是旧的教程中的库,但 99% 是较新的)。所以,当我
有没有办法使用 dylib 的路径查找其版本?我正在寻找接受与 dlopen 相同参数的东西。我查看了 NSVersionOfRunTimeLibrary,但从我阅读的文档来看,它似乎获取了当前 dy
我正在从源代码构建 cyrus sasl2 库。库安装在/usr/local/lib 中, header 安装在/usr/local/include/sasl 中,这是正确的。 但是,当我运行尝试使用
我确定 .A 意味着什么,但搜索它只会产生噪音。请赐教。 最佳答案 哦,它们是一样的。 -rwxr-xr-x 1 root wheel 4969408 Sep 25 16:06 libicuco
我已经从我的 iOS 应用项目构建了一个 ipa 包。使用 zip 打开 .ipa 文件后。我发现这里有很多 swift 支持的动态库。 我想知道 libswiftFoundation.dylib 和
在带有 gcc-5.2 的 g++ 的 mac os x 下,我正在尝试执行以下操作:创建一个 dylib,导出由 header tmp8bis_dylib.h 定义的类和来源 tmp8bis_dyl
我正在使用 py2app 从 Python 代码创建一个应用程序。 一切顺利,直到我运行 setup.py,然后在它运行的最后我收到这条消息:“ValueError: '/Users/(my_comp
我有一个旧的 iOS Xcode 项目,我在其中使用了 libxml2.dylib 和 libresolv.9.dylib。安装 XCode7 后。 我找不到文件,也不知道去哪里搜索。有人可以帮助我吗
我开始在我正在开发的应用程序中使用 SQLite 数据库。我还没有遇到问题,但是来自 this tutorial 的早期步骤之一正在链接 SQLite3 框架。本教程需要 libsqlite3.0.d
我正在为 Xamarin.Mac 创建绑定(bind)/MonoMac 。我想嵌入 dylib在生成的dll中就像 Xamarin.iOS 上所做的那样与 [LinkWith]属性。 可以这样做吗?如
C++ dylib 暴露如下 __attribute__((visibility("default"))) int addNumber(int number) { return 0; } 在我
目前我正在使用 libxml2.dylib 来解析 XML 现在我想转移到 libxml2.2.dylib。那么,我会在配置和编码方面做什么样的改变? 最佳答案 Xcode 4.5(和重要的 iOS6
在使用 matplotlib 时获取错误信息: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already ini
我已经创建了一个Python应用程序,并使用Pyinstaller将其构建到Unix可执行文件中。在我尝试对应用程序进行代码签名之前,应用程序运行得很好。在代码签名之后,我在尝试运行可执行文件时收到以
我正在尝试在应用程序上使用 Parse,我是 swift 的新手。但是我下载了 Xcode 7,似乎 libz.dylib libsqlite3.dylib 丢失了,当我编译和构建它时,它已成功完成,
我在尝试在任何脚本上使用 Pilow 时遇到此错误: File "/Users/antonio/WWW/myproj/myproj/functions.py", line 12, in
我是一名优秀的程序员,十分优秀!