Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

PCL for iOS and Android: runtime version confusion

$
0
0

The attached solution has a simple PCL setup that exhibits some confusing behaviour. There is a common PCL library (targeting .NET 4.5 + W8 = Profile7) containing a single simple class MyPortableClass and two platform-specific projects: one for iOS and one for Android.

Both "apps" try and instantiate MyPortableClass on startup and this works for iOS, but not for Android:

The type System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assemblySystem.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Sure enough, the Android reference to the System library references version 2.0.5.0, but so does the iOS project and it compiles. I suspect it's a bug, but I'm not ruling out user error (or at least confusion) yet.

If I switch the library to target Profile158 (tick all the boxes), then it compiles fine.

I'm on the latest Alpha channel:

=== Xamarin Studio ===

Version 4.1.7 (build 87) Installation UUID: 0f7f45c0-0072-4ed6-88cb-db930097e9cf Runtime: Mono 3.1.2 ((no/71af847) GTK 2.24.20 GTK# (2.12.0.0) Package version: 301020000

=== Apple Developer Tools ===

Xcode 4.6.3 (2068) Build 4H1503

=== Xamarin.Android ===

Version: 4.8.0 (Trial Edition) Android SDK: /Users/rupertrawnsley/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) Java SDK: /usr java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: 6.3.8.11 (Trial Edition) Hash: bc5a95b Branch: Build date: 2013-17-07 15:48:27-0400

=== Build Information ===

Release ID: 401070087 Git revision: e8d353852416693588e6e53a5c2b2d70e5ddadfb Build date: 2013-07-18 15:32:11+0000 Xamarin addins: 7a764a450cd980c7942b91f12ac36947f9c6a71f

=== Operating System ===

Mac OS X 10.8.4 Darwin Ruperts-MacBook-Air.local 12.4.1 Darwin Kernel Version 12.4.1 Tue May 21 17:04:50 PDT 2013 root:xnu-2050.40.51~1/RELEASE_X86_64 x86_64


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>