在 Xamarin IOS 应用程序中使用 Hockey SDK 时链接失败

Linking failed when using Hockey SDK in Xamarin IOS App

我有一个 Xamarin.forms 应用程序。在 iOS 项目中,我通过在 AppDelegate.cs 中添加以下代码从 here and followed the samples here 安装了 HockeyApp 包:

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
    //We MUST wrap our setup in this block to wire up
    // Mono's SIGSEGV and SIGBUS signals
    HockeyApp.Setup.EnableCustomCrashReporting (() => {

        //Get the shared instance
        var manager = BITHockeyManager.SharedHockeyManager;

        //Configure it to use our APP_ID
        manager.Configure ("YOUR-HOCKEYAPP-APPID");

        //Start the manager
        manager.StartManager ();

        //Authenticate (there are other authentication options)
        manager.Authenticator.AuthenticateInstallation ();

        //Rethrow any unhandled .NET exceptions as native iOS 
        // exceptions so the stack traces appear nicely in HockeyApp
        AppDomain.CurrentDomain.UnhandledException += (sender, e) => 
            Setup.ThrowExceptionAsNative(e.ExceptionObject);

        TaskScheduler.UnobservedTaskException += (sender, e) => 
            Setup.ThrowExceptionAsNative(e.Exception);
    });

    //The rest of your code here
    // ...
}

当我尝试编译程序时 Visual Studio 抛出以下错误(以及更多此类错误):

Severity Code Description Project File Line Suppression State Error Native linking failed, undefined symbol: std::__1::__vector_base_common::__throw_length_error() const. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. App.iOS

当我评论那段代码时,一切都运行良好。 有什么建议吗?有人在 ios xamarin 表单项目中成功设置了 Hockey 吗?

您的目标是 iOS 6 吗?

如果 HockeyApp 组件上的 getting started section 是这样的话,它指出:

Targeting iOS 6.0

If you would like your app to target iOS 6.0 you will need to add the following arguments to your application project settings.

Open project Options Under Build -> iOS Build Go to the Additional Options -> Additional mtouch arguments and add: -cxx ->gcc_flags "-lc++"

这个bug也说了同样的话