Parse and Xamarin - parse-platform

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.

Related

Requiring unreferenced assemblies to be included in Xamarin App package

I have a Xamarin Forms app that requires me to dynamically load a single one of several possible assemblies at runtime (based on versioning). This should not be a problem as iOS can load assemblies using the mono interpreter. The problem I face is that the IPA and APK packages do not include the assemblies because they are not referenced directly in the app. I include them in the project references but they do not appear in the app package.
Is there a way to tell Xamarin to always include an assembly in the package regardless if it is being directly referenced in code?
==UPDATE==
I have a complete working POC with what I am trying to accomplish in terms of versioning in the application.
https://github.com/rlasker-b2w/XamVersioning
I specifically have to add references in the VersionSelector class otherwise the version projects do not get their assemblies added to the app package.
https://github.com/rlasker-b2w/XamVersioning/blob/main/VersionApp/VersionSelector.cs

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.

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

Integrating C/C++ code in Xamarin for iOS

Under Visual Studio 2015, I have integrated Android C++ code into Xamarin and it works as expected. Now, I am trying to do the same for iOS and am running into some basic issues.
I am assuming the integration mechanism is the same for iOS as that of Android in the sense that a shared library (probably .so) is created that one can load using DllImport in C# code.
When I try to add a new C++ project for iOS to my solution, the only option that seems to make sense is Visual C++-->Cross Platform-->iOS-->Shared Library. I added this project type as MyTestShared. This actually ends up creating three projects - MyTestShared.Shared, MyTestShared.iOS, and MyTestShared.Android. Project MyTestShared.iOS already has an external method defined as char* iOSInfo(). However, when I try to add project MyTestShared.iOS as a reference to my MyMainApp.iOS project, I see an error "A reference to MyTestShared.iOS could not be added. An assembly must have a dll or exe extension."
Questions:
For Android C++, it generates exactly one project. Why does it create three projects for iOS C++?
How do I add a reference to MyTestShared.iOS? What is it that I am missing?
I see there is an option to create a static C++ library for iOS. Can I reference it somehow in my C# code?
Regards.

Resources