I am trying to use Xam.Plugin.Connectivity 2.3.0 by James Montemagno in my Cross platform Xamarin app. The package is installed in all the three projects i.e. protable, android and iOS. But whenever i try to check connectivity, it throws NotImplementedException. This behaviour is independent of whether i try to access it in the portable or platform specific project. This is the code with which i try to access it
if (CrossConnectivity.Current.IsConnected)
{
//business logic
}
The exception details are as follows
System.NotImplementedException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
I have read similar posts on various forums, but none helped.
I have this
version installed and it works for me. download and install same version and try again. Hope that helps.
I got the same problem. Finally I found out that I only added the Xam.Plugin.Connectivity in PCL but I didn't add the package in the Android folder too. You add the package in Android folder again and it should works.
Related
I have researched this for hours and can't figure out how to fix this issue. Every time I launch my app i get the error stated in the title. I currently have sql-net by Frank Krueger nuget package installed. I reference 'using SQLite;' in my code which looks at SQLite.cs and SQLiteAsync.cs. I was reading that installing the nuget package sql-net-pcl by Frank Krueger can resolve this issue? If so, how would I use this since I can't reference the two SQLite classes anymore if I do install it.
I currently have sql-net by Frank Krueger nuget package installed.
You're using the old SQlite version which is not compatible with Android 7.0 and higher version, if you installed the some SQLite relative library, please refer to this doc: Preparing for Native Library Linking Changes in Android N, and try to update your library as the doc suggested.
For sql-net package, you can try to install the sqlite-net-pcl package.
I was working with Unity and Hololens and tried to establish connection to Azure Iot Hub via MQTT protocol. Microsoft provides a tutorial for getting started with Azure IoT Hub in C#, but unfortunately, I encountered a problem with the tutorial:
In the picture above, I have selected Microsoft.Azure.Device NuGet package for installation. I have tried version 1.0.0 and also the latest one available, 1.2.4. The projects were automatically generated by Unity and that is probably the reason, why I do encounter this problem. Which problem? After I try to install the selected NuGet, I encounter the following error:
Could not install package 'Microsoft.Azure.Devices 1.2.4'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v3.5,Profile=Unity Full v3.5', but the package
does not contain any assembly references or content files that are
compatible with that framework. For more information, contact the
package author.
I was like, "Hmm, I must have wrong .NET framework version. I wonder if I can change that..." I tried to go to project properties like this
Microsoft advises changing .NET framework from Properties context menu item:
https://technet.microsoft.com/fi-fi/library/bb772098(v=vs.90).aspx (4.24.2017)
https://msdn.microsoft.com/en-us/library/bb398202(v=vs.100).aspx (4.24.2017)
However, this feature must be blocked by something, because the view that is supposed to open flashes white and disappears immediately. I suppose Unity doesn't like people tinkering with project properties, but what else can I do? Incompatible .NET framework issue needs to be resolved, so that the NuGet package can be installed, but how do I do that?
In short, how to install Microsoft.Azure.Devices NuGet package for Unity?
Sorry, this isn't possible due Unity's restriction to .net 3.5.
To be exactly, they use a custom version of mono-2.
You could try the new (experimental) .net 4.6 settings in Unity 5.6.
https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/
This is my first attempt at a Xamarin Android project. I have created a SignalR server in a console application and this is working fine. I am trying to create a Xamarin Android project in Visual Studio that can use SignalR to connect to my server. I have used nuget to add
Microsoft.AspNet.SignalR.Client
and
Newtonsoft.Json
When I try to build the project I am getting tthis error.
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assemblySystem.Net.Http.Extensions, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Perhaps it doesn't exist in the Mono for Android profile?
I can't find anything on Nuget called
System.Net.Http.Extensions.dll
I have tried this and it works with VisualStudio 2015
I downloaded the complete package from Xamarin account which is just one step to create.
And then go to the signalR package for Xamarin, and download the complete package.
the go for the following path
yourdownlodfolder\signalr-2.1.2.2\signalr-2.1.2.2\lib\android
you will find something like
Include it in your bin folder. and than add refenrences manually .
and you are done. Now follow the steps mentioned in the above link to create HubProxy
I'm facing the same problem.
After install the SignalR Client on my Xamarin Forms PCL application, the Android app breaks on build.
I opened a issue on the github. Posted a simple repo app.
The SignalR is the major functionality, so I'm pretty much stuck.
https://github.com/SignalR/SignalR/issues/3775
In my case, to solve the problem i installed the nuget Microsoft.Net.Http and rebuild de project.
At the moment I'm trying to launch empty app with cross-platform solution in Xamarin Studio.
I've tried make app with empty library project and shared library, both has same errors. Now unresolved problems are:
1) Build error:
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file classes.jar doesn't exist. (XA5207) (*projectName*)
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file libs/internal_impl-21.0.3.jar doesn't exist. (XA5207) (*projectName*)
This question didn't help me.
2) Some links says it could be because of old Mono.Android.Support.v4 component. My component version is 21.0.3.0. After clicking for update it says:
You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework.
My Mono.Android assembly version is 0.0.0.0 and I dodn't know how to update it.
I've tried PCL project with PCL 4.5 - profile7. New projects builds normal, but after first project clean it gives me error about not found classes.jar file like described above. Another new PCL project still builds fine.
UPDATE
Error in PCL project occures not after clean - it occures with included Xamarin.Forms NuGet to Android project.
UPDATE
After rising target framework of android project to v4.0.3 I successfuly updated Mono.Android.Support.v4 component, but it still show me error about Please install package.
UPDATE
I'm using Windows 7 OS, same problem with all users including new user. But on another computer with Windows 8 it works. It is not a solution for me, but it can somehow help someone.
i think your java JDK and JRE not install properly and your path not set in your environment variable you must add your jdk path in that and if you are make application using cross platform then also add path SDK in your computer environmental variable. using CMD throw creating project.
I'm using PCLStorage for a Win8/Wp8 project I'm working on. I'm using it within a PCL itself, and have it referenced in my Win8, Wp8 and PCL projects. Everything is working great in Win8.
In Wp8 however, once I hit my PCL for storage which uses PCLStorage, I'm getting a NotImpmlementedException when I call FileSystem.Current;
"This functionality is not implemented in the portable version of this assembly. You should reference the PCLStorage NuGet package from your main application project in order to reference the platform-specific implementation."
But like I said, I have the PCLStorage NuGet package referenced in my Wp8 project AND the PCL project the same way I do in my Win8 project.
Any idea what's happening?
(I should also note that PCLStorage is working fine if I use it in a new Wp8 project)
Try uninstalling the PCLStorage NuGet package from all projects and then reinstalling it in all of them.
If it still doesn't work, try checking the references to the PCLStorage DLLs in the WP8 project and make sure they are coming from the wp8 folder in the package.
If that doesn't lead anywhere, try setting copy local to false in the references from your PCL to the PCL Storage DLLs. If you have to do that it's an issue that needs to be fixed, so please file a bug for it.
EDIT: There is a bug in VS 2013 Update 2 RC that can cause this problem. This NuGet package is supposed to fix the issue if you reference it in your Windows Phone app: SuppressPackagingPclFacades. Alternatively setting Copy Local to false for the reference from your PCL library to the PCL Storage assemblies should also fix the issue.