简体   繁体   中英

Linking failed when using Hockey SDK in Xamarin IOS App

I have a Xamarin.forms app. In the iOS project I installed the HockeyApp package from here and followed the samples here by adding the following code in my 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
    // ...
}

As soon as I try to compile the program Visual Studio throws the following error (and some more of that kind):

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

When I comment that code piece everything runs fine. Any suggestions on that? Anybody who successfully setup Hockey in an ios xamarin forms project?

Are you targeting iOS 6?

If so from the getting started section on the HockeyApp Component it states this:

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

Also this bug says the same thing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM