Portable Class Library project - reference assemblies not installed? - xamarin.ios

I'm using Xamarin Studio Version 4.2.3 on a Mac (Starter Edition; Mono 3.2.6; Xamarin.Android Version 4.12.1; Xamarin.iOS Version 7.2.02).
I created a blank solution. I added an Android application project and an iPhone application project. Both build and run okay. Now I've added a Portable Class Library project which I want to link to from my application projects. However! My Portable Class Library project is showing up an error in my References folder for the .NET Portable Subset reference, as follows:
Framework not installed: .NETPortable,Version=v4.0,Profile=Profile136
How do I resolve this??
Additionally, when I open the Project Options window and navigate to the General section, the only Target Frameworks listed are:
.NET Framework 4,
Silverlight 4,
Windows Phone 7,
Xbox 360.
No Xamarin.Android and no Xamarin.iOS...

Please check you have the Mono MDK, not the MRE.

I installed the MDK (whatever that is??) from the following directory...
http://download.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-3.2.6.macos10.xamarin.x86.pkg
... and that fixed things for me. No need for an uninstall and reinstall of my Xamarin setup.
Note that I had to quit and restart Xamarin Studio for the change to take effect. I also restarted my Mac for good measure!

That's weird. I don't have Xbox as an option on my Mac. I have it as an option on Windows (Xamarin Studio & Visual Studio). What edition of Xamarin do you have installed?
Maybe you need to reinstall it?
My machine:
=== Xamarin Studio ===
Version 4.2.3 (build 60)
Runtime:
Mono 3.2.6 ((no/9b58377)
GTK+ 2.24.23 theme: Raleigh
GTK# (2.12.0.0)
Package version: 302060000
=== Apple Developer Tools ===
Xcode 5.1 (5084)
=== Xamarin.iOS ===
Version: 7.2.0.2 (Business Edition)
Hash: 58c3efa
=== Xamarin.Android ===
Version: 4.12.1 (Business Edition)
=== Xamarin.Mac ===
Xamarin.Mac: Not Installed

Related

Kotlin Multiplatform Mobile - Issue while running ios app from Android studio

I'm exploring KMM, I have done with the setup in Android Studio. I could able to run the Android app perfectly, but when I try to run the ios app, facing an issue in configuration setup. Xcode project scheme Dropdown is empty. I have attached a screenshot for reference.
Android Studio v4.1.2
Xcode 11.4
Mac OS 10.15.4
Kotlin plugin version
1.4.20.
Note:
I tried specifying the Xcode project location. But no luck.
But when I launch the ios App directly from Xcode, the app is working perfectly.
For your Kotlin version, the KMM plugin version should be 0.2.0 in accord with this release page https://kotlinlang.org/docs/mobile/kmm-plugin-releases.html#release-details.
I solved using Kotlin v1.5.0 e KMM v0.2.4.

Xamarin.iOS MvvmCross template; can't open storyboard

I get the following error when I attempt to open a storyboard for a project I created from the "MvvmCross Single Page Native Application" template:
"Project /Users/username/Desktop/MyProject.iOS/obj/Xcode/0/MyProject.iOS.xcodeproj cannot be opened because the project file cannot be parsed."
Everything works fine if I use any of the iOS app templates.
I'm running the following environment:
Visual Studio Community 2017 for Mac (Preview)
Version 7.4 Preview (7.4 build 1026)
Installation UUID: d672627e-29b7-49bc-8b23-bb090208de99
Runtime:
Mono 5.8.0.127 (2017-10/1eac626536b) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 508000127
Xamarin.iOS
Version: 11.8.0.20 (Visual Studio Community)
Hash: 1c6f300e
Branch: d15-6
Build date: 2018-02-07 23:42:40-0500
I'm running preview so that I can target Android 8.1 for another project but I was having the same issue with the stable release.
Thanks for the help.
Upgrade your Visual Studio to Preview 8 , it should can solve the problem.
Refer to here.

Xamarin ios unified version is not allowed to install Mvvmcross

I have updated xamarin ios from classic api to unified api.
When i trying to add Mvvmcross nuget package it shows following error
Could not install package 'MvvmCross.PortableSupport 3.2.2'. You are trying to install
this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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.
Please help.
The MvvmCross.PortableSupport 3.2.2 NuGet package contains an empty Portable Class Library folder and can be installed into a Xamarin.iOS project if you have the Portable Class Libraries installed for Xamarin and if you have the latest version of NuGet installed.
So you may not have the PCLs installed for Xamarin or, if you are using Visual Studio, then your NuGet version may be too old and need to be updated.
To get the Portable Class Libraries:
If you are on the Mac you should install the Mono Development Kit (MDK).
If you are on Windows then things are can be more complicated. The simplest way is to install Visual Studio 2013 (full or Express) Update 2 or higher. The more complicated way is to install the Portable Library Tools and the Portable Library Reference Assemblies 4.6. The Portable Library Reference assemblies installs a PortableReferenceAssemblies.zip file which contains three directories (4.0, 4.5 and 4.6). These three directories need to be extracted and copied into the PCLs directory:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable
Finally on Windows you would then need to reinstall Xamarin. The easiest way to do this is to find Xamarin in the Control panel's Programs and Features and select the option to Repair it.

Strange error about type defined multiple times with PCL

I have Xamarin.Android, Xamarin.iOS and Windows Phone 8 applications, both referencing common PCL library. Inside this library I am using HttpClient, and because WP8, I need nuget package Microsoft.Net.Http.2.2.22
Without enabling compression on HttpClient everything works fine on all 3 platforms. However, after changing code to
var handler = new HttpClientHandler();
if (handler.SupportsAutomaticDecompression)
{
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
}
httpClient = new HttpClient(handler);
there is build error with the library on iOS (both Android and WP works fine with this) telling me about multiple definition of DecompressionMethods. What is strange - the second assembly mentioned in error is System.Net.Primitives.dll - which DOES NOT contain definition of DecompressionMethods (i even checked in ILSpy).
Of course, I tried clean solution, rebuild, close/open Xamarin Studio etc...
Error :
MyApiHttpClient.cs(30,50): error CS0433: The imported type `System.Net.DecompressionMethods' is defined multiple times
/Users/vtoth/myprototype/Services/CommonServices/../../packages/Microsoft.Net.Http.2.2.22/lib/portable-net40+sl4+win8+wp71+wpa81/System.Net.Http.Primitives.dll (Location of the symbol related to previous error)
/Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile49/System.Net.Primitives.dll (Location of the symbol related to previous error)
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "/Users/vtoth/myprototype/Services/CommonServices/CommonServices.csproj".-- FAILED
EDIT:
Version info about dev environment:
=== Xamarin Studio ===
Version 4.2.4 (build 35) Installation UUID:
(...) Runtime: Mono 3.2.6
((no/9b58377) GTK+ 2.24.23 (Raleigh theme)
Package version: 302060000
=== Apple Developer Tools ===
Xcode 5.1.1 (5085) Build 5B1008
=== Xamarin.iOS ===
Version: 7.2.1.42 (Business Edition) Hash: 773c77c Branch: Build
date: 2014-04-18 15:39:16-0400
=== Xamarin.Mac ===
Xamarin.Mac: Not Installed
=== Xamarin.Android ===
Version: 4.12.3 (Business Edition) Android SDK:
/Users/vtoth/Library/Developer/Xamarin/android-sdk-mac_x86 Supported
Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.3 (API level 18)
4.4 (API level 19) Java SDK: /usr java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java
HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
=== Build Information ===
Release ID: 402040035 Git revision:
1173cb1c45bc56cb702e82cd21a7c9d0cea4acbf Build date: 2014-04-17
13:45:52-04 Xamarin addins: 53bde0041263928e8bd64686f5ca5a8e4338dd76
=== Operating System ===
Mac OS X 10.9.2
After discussing in the comments, it seems to me that you are running an old version of Xamarin Studio, Xamarin.iOS, and Xamarin.Android.
Please make sure you have at least the following stable versions or newer (which are available on the stable channel currently:
Xamarin Studio: 5.0
Mono: 3.4.0
GTK#: 2.24.23
Xamarin.iOS: 7.2.3.39
Xamarin.Android: 4.12.4
XCode: 5.1.1
Please try updating and your problems should go away, plus you'll get a much nicer version of Xamarin Studio to work with!

Get application version in Xamarin.iOS no longer working?

I'm using
string version = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleVersion").ToString();
to get my app's version. It is set to 1.2.0
However the code above returns 1.0. I have already recreated info.plist without success.
I know I used the same code in previous projects, so what changed?
Of course I have already tried to clean and rebuild.
Xamarin Studio Version 4.1.12 (build 6) Installation UUID:
b8bdc5a1-348b-4fad-8e4f-4632ee990c59 Runtime: Mono 3.2.3
((no/8d3b4b7) GTK+ 2.24.20 theme: Raleigh GTK# (2.12.0.0) Package
version: 302030000
Apple Developer Tools Xcode 5.0 (3332.25) Build 5A1413
Xamarin.iOS Version: 7.0.2.7 (Indie Edition) Hash: 57edee2 Branch:
Build date: 2013-04-10 18:05:51-0400
The "Version" entry in the UI actually maps to CFBundleShortVersionString just like Xcode does. The "Build" entry is what maps to CFBundleVersion.
Hope that helps.

Resources