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

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.

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.

How to correct reference Xamarin PCL class?

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?

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

error MSB3541 when deploying a Windows UWP cross platform application

Recently I created a sample Xamarin cross platform application using Visual Studio 2017. The Android project under this solution runs and it is debugged without any error, but the Windows UWP project solution, previously needs to be build and deployed in order to debug it. There is an MSB3541 error when trying to deploy UWP project.
This is the detailed error:
Microsoft.Common.CurrentVersion.targets(4686,5): error MSB3541: Files has invalid value "obj\x86\Debug\DebtAppXamarin.UWP.c_.users.dafpc.documents.visual_studio_2017.Projects.DebtAppXamarin.DebtAppXamarin.DebtAppXamarin.Views.ItemDetailPage.xaml.g.cs". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
The specified file ...ItemDetailPage.xaml.g.cs actually does not exist in the directory ...DebtAppXamarin.UWP\obj\x86\Debug\.
I have tried to clean and rebuild solution but the same problem is again.
Also I have created the same new project but the same error is present.
Is there any problem when naming project files in obj directory , or the error might be somewhere else?
I could not find a solution for my current project even by reinstalling Xamarin Forms or updating VS 2017. What I did is that I created a new cross platform project using Xamarin Forms , but this time I choose a different code sharing strategy like Portable Class Library (not a shared project), after setting up project template details the application was running smoothly, without any build errors or warnings.

Parse and Xamarin

I am using Xamarin and I was wondering if there is a way to run Parse in a shared project, so that I don't have to duplicate my code in the iOS project and the Android project in my solution?
Am I missing something, or do I really have to duplicate the Parse code?
What I did was create a Shared Project type to host my Parse specific Code. Then in my Xamarin.Android app, I reference the Parse.Android.dll. In my Xamarin.iOS code, I referenced the Parse.iOS.dll. Remember, that the "Shared Project" type does not create a DLL. Underneath the hood it's just file linking into your actual project, so it will use the references of that project. The Shared Project should not contain any iOS or Android specific code.

Resources