Mono For Android MapsAndLocationDemo - c#

I have Mono for Android trial version and am having some trouble with the MapsAndLocation demo.
I start up the emulator, yet when I select 'Run->Start Without Debuggin', I get the following error:
C:\Users\Simon\Documents\Xamarin\MapsAndLocationDemo\xamarin-monodroid-samples-d76baf3\MapsAndLocationDemo\obj\Debug\android\src\mapsandlocationdemo\MapWithOverlayActivity.java(33,33): Error: package com.google.android.maps does not exist
extends com.google.android.maps.MapActivity
As well as another 20 errors.
What do I need to fix this situation. Do I need to install an additional package? If so, what is it, and where can I find it?
thanks

Please ensure you are deploying to an emulator that targets Google APIs.
To do this create a new emulator in the Android Virtual Device Manager and change the target from "Android 2.2 - API Level 8" to Google API eg. "Google APIs (Google Inc.) - API Level 16".
If you cannot see any Google API targets you will need to install one by using the Android SDK manager.

Related

How do I integrate Firebase.Crashlytics on my Xamarin.Forms Project

Can any one help me with integrating Firebase.Crashlytics on a Xamarin.Forms project for iOS.
It is working fine for me on Android but on iOS I am facing issues.
Note that I have performed the following steps on iOS :-
Added Xamarin.Firebase.iOS.Crashlytics Nuget package to my iOS project.
Added GoogleService.plist file
Made a dependency service for iOS
Added the following code to initialize the nuget :-
Firebase.Core.App.Configure();
Crashlytics.Configure();
Fabric.Fabric.SharedSdk.Debug = true;
Crashlytics.SharedInstance.Crash();
Update
I have followed all the steps in the below mentioned link :-
https://keithbeattyblog.wordpress.com/2019/06/16/xamarin-forms-adding-google-firebase-crashylitics/
Still nothing works.
When I follow the steps written in the above article I face issues where I am unable to build my project due to the 'Xamarin.Build.Download' NuGet package. Also I face issues where I am unable to deploy the solution to my Simulators because it doesn't allow me select a simulator to run the App.
Any help would be appreciated. Thanks!
Are you sure you want still go with the old Fabric implementation?
You must be aware that the Fabric Crashlytics version is deprecated, right?
All of us have received a mail from Google informing that:
We are writing to let you know that the Fabric Crashlytics SDK is now deprecated and will continue reporting your app's crashes until
November 15, 2020. After this date, the Fabric Crashlytics SDK and
beta versions of the Firebase Crashlytics SDK will stop sending crash
reports for your app.What happened?
We are replacing Fabric Crashlytics SDKs and beta versions of the Firebase Crashlytics SDKs with the generally available Firebase
Crashlytics SDKs.What's Next?
To continue getting crash reports in the Firebase console, make sure to upgrade your apps to the Firebase Crashlytics SDK versions
17.0.0+ for Android, 4.0.0+ for iOS, and 6.15.0+ for Unity before November 15, 2020.Android
So everything is going to change soon, and you shouldn't use the Fabric solution anymore, especially for new projects.
You can find the new official NuGet package here, but it is still in preview:
https://www.nuget.org/packages/Xamarin.Firebase.Crashlytics/117.0.0-preview02
This is the official repository issue to add comments:
https://github.com/xamarin/XamarinComponents/issues/956
When you'll add this new package and the google-services.json you will need to change the following in your old code:
Every CrashLytics.Crashlytics reference will be just FirebaseCrashlytics.
No initialization is needed, you can get the FirebaseCrashlytics.Instance anywhere
To log an exception you will need to use the RecordException method instead of the old LogException
SetUserIdentifier is changed to SetUserId, and SetUserName is no longer there
There is no method to crash on purpose anymore, so now you have to simply throw any exception you want if you wanna test your implementation
Maybe I'm missing something, but basically, that's all.
Update Xamarin.Firebase.iOS.Crashlytics to version 4.0.0-beta.7
and in your app delegate just call
Firebase.Core.App.Configure();
Firebase.Analytics.Analytics.LogEvent(Firebase.Analytics.EventNamesConstants.SelectContent, new Dictionary<object, object> {
{ Firebase.Analytics.ParameterNamesConstants.ItemId, "hokisit-ios" },
{ Firebase.Analytics.ParameterNamesConstants.ItemName, "Hokisit iOS" }
});

Can't install because provider name com.iceteck.silicompressor.provider (in package MyPackagename2) is already used by Package1

my App is not installing in my android device if another app(that app also used silicompressor nuget) is installed on my device. I have checked out with manifest file,android:authorities="${applicationId}.fileprovider" and both apps having different android:authorities name only. What is the actual problem causing this exception. Please help to resolve this Error using xamarin forms.
Mono.AndroidTools.InstallFailedException:Failure[INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/MyPackagename2-FNVNvrTmReyC06yRui516g==: Can't install because provider name com.iceteck.silicompressor.provider (in package MyPackagename2) is already used by Package1
By any chance are you using any Android X library in your xamarin forms application? Is silicompressor a library that works with the android content file provider

Xamarin Forms - Plugins.BLE - MvvmCross.Plugins.BLE

I want to develop an app with Xamarin Forms which detects devices and interacts with them by bluetooth connection.
The plugin "Plugins.BLE" seems good to me for my request. I found this plugin here : https://github.com/xabre/xamarin-bluetooth-le
I did not find the plugin "Plugins.BLE" when I wanted to install it in Xamarin Studio, so I tried to use the MvvmCross.Plugins.BLE plugin. So I downloaded it and installed it in my project. A reference to MvvmCross.Platform has been installed in the same time. I set the permissions for bluetooth in the AndroidManifest.xml.
I have many problems with this plugin. In the first place, I initialized an adapter like this :
var adapter = Mvx.Resolve<IAdapter>();
I put this code in my App.xaml.cs but I got a NullReferenceException when I build.
Otherwise, when I put
var ble = Mvx.Resolve<IBluetoothLE>();
Xamarin Studio does not recognize the IBluetoothLE interface.
Maybe errors come from MvvmCross using. I don't want to use MvvmCross so if the plugin "Plugin.BLE" is available I would like to use it but I did not find it.
You have to search for pre release. Currently we haven't released a "stable" 1.0 without the "-beta" postfix. Every package thats version have "-foo" postix are recognized as prerelease by nuget.
The null reference exception is a typical error if you haven't referenced the platform specific package in your iOS or Android app. Running the package on a simulator can cause some problems, too. We are working on this.

Mkdirs Xamarin does not work on Android 6.0

I have a pretty simple android application written on Xamarin and running on two different virtual devices: on Genymotion Google Nexus 5 - Android 5.1.0 and Genymotion Google Nexus 6P - Android 6.0.0. After some debugging I've discovered that Mkdirs does not create the directory on my virtual device. How can I get the reason why? My guess is that my app does not have permissions to save the files or create directories on device's external storage even though WRITE_EXTERNAL_STORAGE permission is set to true. Are there some changes in Android 6 permissions?
Android 6.0 introduced Runtime permissions. In addition to declaring the permission on your manifest, you need to request the permission from the user at runtime.
More info and tutorials here: http://developer.android.com/training/permissions/requesting.html
For Xamarin specific information: https://blog.xamarin.com/requesting-runtime-permissions-in-android-marshmallow/

Azure media service for shared app

I've been trying to use the Azure Media Service for a shared native app in Visual Studio 2015.. But whenever i try to install the windowazure.mediaservices.extensions package, i get an error because apparently it isn't cross platform compatible on all three OS. However i can add another nuget Microsoft.windowsAzure.Managment.MediaServices - but it does not give me the same namespace as the one i get with the media services samples i downloaded earlier.
Does anyone have experince with the two nugets - and can tell me the difference? And if so - could provide me with a link to a sample that uses the last mentioned nuget.
An additional remark/question - i cannot get it to work on xamarin.forms either - not on shared or portable project.

Categories