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.
Related
I have a Hololens app built using Unity 2019.3. Within the app, I am trying to use a onClick event on a button to open Microsoft Dynamics Remote assist.
I have tried to follow this tutorial. https://learn.microsoft.com/en-us/archive/blogs/appconsult/call-remote-assist-from-your-hololens-app
This tutorial says to use .net as the scripting backend, however Unity 2019.3 only allows IL2CPP as the scripting backend.
Have tried the code from this thread as well but still not working.
Execute "LaunchUriAsync" from a click of a HoloLens UI Button
Getting the following errors:
I tried a new project in Unity 2018.4 with scripting backend set to .NET and getting similar errors there as well.
I can't find anything online on how to get Launcher.LaunchUriAsync to work.
This tutorial says to use .net as the scripting backend, however Unity 2019.3 only allows IL2CPP as the scripting backend.
That doc is a bit outdated. We recommend using the latest Unity LTS (Long Term Support) as the best version so that we can avoid some known issues, and the current recommendation is to use Unity 2019.4.20f1.
And we don't need to set .NET as Scripting Backend anymore since IL2CPP is the best and only choice for now.
Some key steps are:
Create a new project in the latest LTS version Unity
Ensure the target platform is Universal Windows Platform. See File->Build Settings
Build the Unity project (You choose a folder in which Unity generates a Visual Studio solution; Usually, we create a new subfolder of the Unity project named App).
Open the new generated Visual Studio solution file and set the right configuration, build and run.
If you still need help, please paste the C# script clicker.cs
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" }
});
I have a application UWP that I downloaded for to check how managed UWP with SQLServer from here: https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/SQLServer
When I try to Build the application I got so many errors about the Windows resource is not found,,, I have the last version of VS2017 and also W10 Pro SO....
I tried to add references and reinstall nugets, change the debug type, change the Frameworks... and I don't get works....
Can you tell me what more to do?? Maybe you can download the Project and see the same error than me...
This reference is used to call UWP APIs in "SqlBridge" windows console project.
To call UWP APIs from a classic .NET Framework application, you could install UWPDesktop NuGet package
For more info, please see Calling Windows 10 APIs From a Desktop Application.
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.
I have been exploring the use of MVVM Cross on Xamarin Studio on a Mac. I've been going through the tutorials for N+1 days of MvvmCross on YouTube and I've run into a roadblock that hopefully someone else has experienced.
The tutorials use PCLs and VS 2012, but since I'm on a Mac, I have to use Xamarin Studio. I understand PCLs are not support in Xamarin Studio so I've created a base C# project and then linked the libraries to a Xamarin.Android project. I've read quite a few MvvmCross posts including this one but haven't been able to find a solution.
The project builds successfully and appears to deploy to the emulator successfully, but I can not get the app to run on the emulator. The app immediately closes and the only error I receive is the following non-descript message in the Application Output of Xamarin Studio.
[monodroid-gc] GREF GC Threshold: 1800
[mono] Stacktrace:
[mono]
[mono]
[mono] Unhandled Exception:
[mono] System.NullReferenceException: Object reference not set to an instance of an object
[mono] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
I've set multiple breakpoints but cannot get any them to fire, it appears the error is occurring before my code is run. I downloaded the sample code for the project and it ran successfully so I then went line by line to check for errors but with no success (I even replaced my class files with those from the example. I've confirmed that all of the DLLs are correct. I'm using the precompiled libraries from https://github.com/slodge/MvvmCross-Binaries.
I'm really not sure where to go next to determine the cause of this error. Has anyone else experienced this? I know both Xamarin and MvvmCross focus on Visual Studio integration and PC development; is MvvmCross stable enough to use on Xamarin Studio for a Mac? Does anyone know what my error may be, or what to try next?
I know this is a fairly undefined problem but I'm hoping I'm not the only one to experience this. I've tried to be a descriptive as possible but if anyone need more information, please let me know. Thanks.
Has anyone else experienced this?
No-one I've seen.
I know both Xamarin and MvvmCross focus on Visual Studio integration and PC development
This definitely isn't true for Xamarin - in fact (in my opinion) the reverse is true - I think they work 'Xamarin Studio on a Mac' first, with Visual Studio support second.
For MvvmCross, I generally do work Visual Studio first - this is mainly because I need to use Windows project types (Wpf, WindowsPhone, WindowsStore), because I prefer to use PCLs, and because Resharper owns my coding soul.
is MvvmCross stable enough to use on Xamarin Studio for a Mac?
This is too subjective a question for me to answer. I can tell you lots of Mac-people do use it... and that no-one who has tried has then turned around to me and told me that MvvmCross wasn't stable enough.
The situation with Xamarin PCL support is evolving - the current support seems to change a little with every release currently, and there is a big PCL release coming at some point very soon. This is scheduled for any day now - so I definitely cannot claim that the PCL situation is currently stable.
NuGet2.5 support is also changing - see https://github.com/mrward/monodevelop-nuget-addin/issues/13 - I have no idea when this will be fully available or will know about PCLs on the Mac, but at least the effort has started.
Note: If you want to, then you can always work with Xamarin project types and with file linking instead of with PCL project types. Just because MvvmCross uses PCLs internally it doesn't mean you have to.
Does anyone know what my error may be
I've no idea what your error is there - that NullReferenceException isn't the most verbose error :( You might be able to get more trace from logcat? Other than that, Xamarin forums or support might be able to assist.
what to try next?
I've recorded today's N+1 purely on the Mac without Nuget.
This is currently uploading to:
http://slodge.blogspot.co.uk/2013/05/n22-from-basics-on-mac-n1-days-of.html
http://youtu.be/UC2r4mmj3UI
This is a 'warts and all' live demo of me developing a first Android and iOS project using MvvmCross and PCLs on the Mac. Clearly you can see some issues with things like Xamarin Studio intellisense and with Android emulator debugging (note that these debugger/emulator issues are independent of MvvmCross and PCLs!)
I believe this also shows that right now today on the Mac, Xamarin.iOS is much more mvvmcross/pcl friendly than xamarin.android - but that both are possible to use.
Note that for this demo, I use the assemblies from the VS folder in https://github.com/slodge/mvvmCross-binaries/
I have been same problem.
I have solved migrating my code solution to another new project.
There was no problem with PCL and project link assembly.
I don't know why my solution was broken. I suspect something about package namespace that must be consistent in .xaml and project option.
I know this is an old question, but since there is no real answer to the original question about the null reference exception, here is an issue I ran into and resolved that feels quite similar - Xamarin.Forms app will not run on Android device.