How to correct reference Xamarin PCL class? - xamarin

In Visual Studio 2017, a fresh new Xamarin solution is created with Portable Class Library.
A initial build shows success. But a run gives an error message:
warnings like
Unable to add a reference to project 'App1'. The current project's target is not one of or compatible with the targets of Portable Library project 'App1'.
It is in both App1.iOS and App1.Android.
I have not yet upgrade the Xamarin NuGet package yet. The UWP project can run without any warning or exception.
Look into the project reference on the Android project, we see the broken reference to App1.
Trying to reference that PCL project again, I got
Look into the Property of the App1 PCL project,
What could be wrong? How can I fix the PCL project so it can be correctly referenced by Android and iOS projects?

Related

.Net Standard 2.0 with Realm 3.4.0 'could not resolve reference' Xamarin forms

I have created new Xamarin.Forms project with Android and iOS. After that I installed Realm(3.4.0) in my all 3 projects(PCL, Android and iOS) using nuget. I have also manually added FodyWeavers.xml and I am getting below warning:
could not resolve reference "packages\realm\3.4.0\build..\native\ios\universal\librealm-wrappers.a". if this reference is required by your code, you may get compilation errors.
When I am checking for this file at the specified path, file exists in my system.
For me it's solved by delleting folders bin, obj(Image below) and closing the Visual Studio, after just rebuild it and everithing ok.
Hope it helps.

Xamarin Java Library Binding issues

I want to use agency tango materialintroscreen library in my Xamarin.Android project.
I have created a Xamarin Android Binding Project, copy the ARR file in the Jars Folder and set Build Action to LibraryProjectZip.
Then I reference the project in my main Xamarin.Android project.
Normally I can access to agency.tango.materialintroscreen but have the error the namespace doesn't exist.
I try to use jetBrains dotpeek I saw dll was create well with all class.
I have the same error with 3 library
Visual Studio Error list
Object Browser

Getting "Cannot resolve assembly 'Xamarin.iOS.dll'" in UWP project...?

I've created a working iOS app with Visual Studio 2017 using Xamarin.Forms and a PCL. Now I'm trying to create the UWP app. I've followed the steps here, and when I build, I'm getting the error:
Cannot resolve Assembly or Metadata file 'Xamarin.iOS.dll'
It says it's happening in the MyProject.UWP project, in the MyProject.UWP.csproj file. But there's no reference to that file in MyProject.UWP.csproj (no reference to anything iOS), and there's no reference to that file in the entire UWP project either. So where is it trying to be referenced?
I did notice there's a file in MyProject.UWP\bin\ called project.assets.json. And while there are no references to 'Xamarin.iOS.dll', there are references to 'Xamarin.iOS10' - for example in the file list for the MR.Gestures package, I see listed a "lib/Xamarin.iOS10/MR.Gestures.dll" - not sure why there would be any iOS reference at all there, so that's a little suspicious...although it seems to reference all platforms, including windows phone and android, too, so maybe that's ok.

Getting Microsoft.WindowsAzure.Mobile and Microsoft.WindowsAzure.Mobile.Ext error for android deployments in Xamarin Forms

I have a a Xamarin Forms solution with iOS and Android projects. They connect to an Azure App Service.
After updating my packages in NuGet I'm getting the following error when running my Android project only, iOS is working fine:
System.InvalidOperationException: A Microsoft Azure Mobile Services assembly for the current platform was not found. Ensure that the current project references both Microsoft.WindowsAzure.Mobile and the following platform-specific assembly: Microsoft.WindowsAzure.Mobile.Ext.
I can't find either references in my assemblies or on NuGet.
Any suggestions?
Thanks
try adding the references to the project manually. So Right Click on the References folder in the Android Project, and search for the missing references.
Solved.
The DLLs were located in:
\packages\Microsoft.Azure.Mobile.Client.3.1.0\lib\monoandroid
Once added there was a conflict:
The type 'CurrentPlatform' exists in both 'Microsoft.Azure.Mobile.Client, Version=4.0.1.0, Culture=neutral, and 'Microsoft.WindowsAzure.Mobile.Ext.
Removing Microsoft.Azure.Mobile.Client solved this issue and the app is working again.

The target "GetBuiltProjectOutputRecursive" does not exist in the project when referencing netstandard library

I have a Xamarin Android project, and I am trying to add a reference to my own netstandard1.4 class library. When I add the reference, my Android application will no longer build. I get error MSB4057: The target "GetBuiltProjectOutputRecursive" does not exist in the project.
If I remove the reference, my android project builds fine.
The class library is a brand new library that I just created. It doesn't contain any actual code yet.
I am using Visual Studio 2017.
UPDATE: If I add a reference to my dll using the "Browse" function, it works. I only get the error when I add the reference to the project in my solution.
This appears to be fixed in 15.4

Resources