【问题标题】:Linking failed when using Hockey SDK in Xamarin IOS App在 Xamarin IOS 应用程序中使用 Hockey SDK 时链接失败
【发布时间】:2016-04-19 18:32:45
【问题描述】:

我有一个 Xamarin.forms 应用程序。在 iOS 项目中,我从 here 安装了 HockeyApp 包,并按照示例 here 在我的 AppDelegate.cs 中添加以下代码:

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 会抛出以下错误(以及更多此类错误):

严重性代码描述项目文件行抑制状态 错误本机链接失败,未定义符号: std::__1::__vector_base_common::__throw_length_error() 常量。 请确认所有必要的框架都已被引用 和本机库已正确链接。App.iOS

当我评论那段代码时,一切都运行良好。 对此有何建议?有人在 ios xamarin forms 项目中成功设置 Hockey 吗?

【问题讨论】:

    标签: c# xamarin xamarin.ios xamarin.forms hockeyapp


    【解决方案1】:

    您的目标是 iOS 6 吗?

    如果来自 HockeyApp 组件上的 getting started section 是这样的话:

    面向 iOS 6.0

    如果您希望您的应用程序以 iOS 6.0 为目标,您需要将以下参数添加到您的应用程序项目设置中。

    打开项目选项 在 Build -> iOS Build 下 转到 Additional Options -> Additional mtouch arguments 并添加: -cxx ->gcc_flags "-lc++"

    这个bug也说了同样的话

    【讨论】:

    • 谢谢伙计。我阅读了有关针对 iOS 6 和这些设置的信息,但我没有意识到我的应用实际上针对的是 iOS 6。我对其进行了更改,现在它正在运行...
    • 不用担心,很高兴我能帮上忙。
    猜你喜欢
    • 2019-05-21
    • 2013-09-21
    • 2020-07-19
    • 1970-01-01
    • 2016-09-07
    • 2023-03-18
    • 2012-11-25
    • 2017-12-01
    • 2014-07-02
    相关资源
    最近更新 更多