在Xamarin iOS中使用Firebase Crashlytics [英] using Firebase Crashlytics in Xamarin iOS
问题描述
任何人都可以帮助我如何使用Xamarin iOS的Xamarin.Firebase.iOS.Crashlytics nuget软件包。我在随机位置的代码中遇到了SIGSEGV代码错误,无法确定实际问题。
搜索了很多有关如何在Xamarin iOS中实现Crashlytics的信息,但是我找不到任何东西。
遵循以下两个链接中给出的步骤,但是我只能借助这两个链接在xcode中实现Crashlytics。
链接1 链接2
Could anyone please help me in how to use Xamarin.Firebase.iOS.Crashlytics nuget package for Xamarin iOS. I am getting SIGSEGV code error in my code at random places and I am not able to figure out the actual problem. Have searched a lot regarding how to implement Crashlytics in Xamarin iOS , but I was not able to find any. Have followed the steps given in the below two links, but I was only able to implement Crashlytics in xcode with the help of these two links. Link 1 Link 2
推荐答案
对于iOS:
- 添加GoogleService -Info.plist文件添加到您的应用程序项目中。
- 通过右键单击/构建操作,将GoogleService-Info.plist构建操作行为设置为捆绑资源。
- 将Xamarin.Firebase.iOS.Core NuGet添加到您的iOS项目: https://www.nuget.org/packages/Xamarin.Firebase.iOS.Crashlytics/
-
通常在应用程序中的某些位置添加以下代码行在您的AppDelegate的FinishedLaunching方法中(不要忘记导入Firebase.Core和Firebase.Crashlytics命名空间):
- Add GoogleService-Info.plist file to your app project.
- Set GoogleService-Info.plist build action behaviour to Bundle Resource by Right-clicking/Build Action.
- Add the Xamarin.Firebase.iOS.Core NuGet to your iOS project: https://www.nuget.org/packages/Xamarin.Firebase.iOS.Crashlytics/
Add the following lines of code somewhere in your app, typically in your AppDelegate’s FinishedLaunching method (don't forget to import Firebase.Core and Firebase.Crashlytics namespace):
App.Configure ();
Crashlytics.Configure ();
对于Android:
- 确保在Firebase开发人员控制台中设置了项目。
- 下载项目文件并将其放置在您的Xamarin.Android项目的文件夹。
- 添加Xamarin.Android.Crashlytics NuGet包:> https://www.nuget.org/packages/Xamarin.Android.Crashlytics/
- 重新启动IDE
- 将google-services.json添加到您的Xamarin.Android应用项目中。
- 将构建操作google-services.json设置为GoogleServicesJson
-
创建一个名称为com.crashlytics.android.build_id的字符串资源。该值可以是您要用来唯一标识特定内部版本的任何值。
清理并重建您的解决方案。
- Make sure you have a project set up in the Firebase Developer Console.
- Download your project’s file and place it in the folder of your Xamarin.Android project.
- Add the Xamarin.Android.Crashlytics NuGet package: https://www.nuget.org/packages/Xamarin.Android.Crashlytics/
- Restart your IDE
- Add google-services.json to your Xamarin.Android app project.
- Set the build action google-services.json to GoogleServicesJson
Create a string resource with the name com.crashlytics.android.build_id. The value can be whatever you want to uniquely identify a particular build with. Clean and Rebuild your solution.
Fabric.Fabric.With(this, new Crashlytics.Crashlytics());
Crashlytics.Crashlytics.HandleManagedExceptions();
我最近写了一个博客来整合您的带有Firebase Crashlytics的Xamarin应用程序,其中详细介绍了如何配置它,可在以下位置找到:
I had recently written a blog for integrating your Xamarin Apps with Firebase Crashlytics where I have gone in detail on how it can be configured which can be found here:
https://medium.com/@hakimgulamali88/firebase-crashlytics-with-xamarin-5421089bb561
这篇关于在Xamarin iOS中使用Firebase Crashlytics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!