Bug 20179 - PCLv2 facade assemblies aren't installed when required
Summary: PCLv2 facade assemblies aren't installed when required
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.14.0
Hardware: PC Mac OS
: Highest blocker
Target Milestone: 4.14.0
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-05-29 19:59 UTC by Jonathan Pryor
Modified: 2014-08-05 10:25 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Jonathan Pryor 2014-05-29 19:59:35 UTC
Xamarin.Android doesn't install PCLv2 facade assemblies when they're required. (Or we need to change the definition of "required" and include them in the Mono.Android.DebugRuntime package?)

Repro:

1. git clone https://github.com/conceptdev/xamarin-forms-samples.git

2. Open xamarin-forms-samples/TodoMvvm/TodoMvvm.sln within Xamarin Studio

3. Build the Targets > TodoMvvm.Android project.
   (This ensures that dependencies are downloaded.)

4. Install! (Note: command-line required until Xamarin Studio bumps androidtools ref.)

    $ cd xamarin-forms-samples/TodoMvvm/TodoMvvm.Android
    $ xbuild /t:Install *.csproj

5. Run!

    $ xbuild /t:_Run *.csproj

Expected results: It runs.

Actual results: It doesn't. adb logcat:

> F/monodroid-assembly( 2288): Coult not load assembly 'Xamarin.Forms.Xaml' during startup registration.
> F/monodroid-assembly( 2288): This might be due to an invalid debug instalation.

Arguably, that doesn't look like a PCLv2 issue. So why mention PCLv2?

    # Install Xamarin.Forms.Xaml.dll
    $ adb push bin/Debug/Xamarin.Forms.Xaml.dll /data/data/TodoMvvm.Android/files/.__override__

    # Re-run
    $ xbuild /t:_Run *.csproj

> F/monodroid-assembly( 3623): Coult not load assembly 'System.Collections.Concurrent' during startup registration.
> F/monodroid-assembly( 3623): This might be due to an invalid debug instalation.

Indeed, no PCLv2 facade assemblies are present in the fastdev directory, whereas with 4.12.4 (current stable) there are:

> $ adb shell ls -l /data/data/TodoMvvm.Android/files/.__override__/ 
> -rw-rw-rw- shell    shell       18944 2014-05-29 19:47 QuickTodo.dll
> -rw-rw-rw- shell    shell        7347 2014-05-29 19:47 QuickTodo.dll.mdb
> -rw-rw-rw- shell    shell       15872 2014-05-29 19:47 SQLite.Net.Platform.XamarinAndroid.dll
> -rw-rw-rw- shell    shell       51200 2014-05-29 19:47 SQLite.Net.dll
> -rw-rw-rw- shell    shell        5632 2014-05-29 19:47 System.Collections.Concurrent.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Collections.dll
> -rw-rw-rw- shell    shell        5632 2014-05-29 19:47 System.ComponentModel.Annotations.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.ComponentModel.EventBasedAsync.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.ComponentModel.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Diagnostics.Contracts.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Diagnostics.Debug.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Diagnostics.Tools.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 19:47 System.Dynamic.Runtime.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Globalization.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.IO.dll
> -rw-rw-rw- shell    shell        6656 2014-05-29 19:47 System.Linq.Expressions.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Linq.Parallel.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Linq.Queryable.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 19:47 System.Linq.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Net.NetworkInformation.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Net.Primitives.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Net.Requests.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.ObjectModel.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Reflection.Emit.ILGeneration.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Reflection.Emit.Lightweight.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Reflection.Emit.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Reflection.Extensions.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Reflection.Primitives.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Reflection.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Resources.ResourceManager.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Runtime.Extensions.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Runtime.InteropServices.WindowsRuntime.dll
> -rw-rw-rw- shell    shell        5632 2014-05-29 19:47 System.Runtime.InteropServices.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Runtime.Numerics.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Runtime.Serialization.Json.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Runtime.Serialization.Primitives.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Runtime.Serialization.Xml.dll
> -rw-rw-rw- shell    shell       12288 2014-05-29 19:47 System.Runtime.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Security.Principal.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.ServiceModel.Http.dll
> -rw-rw-rw- shell    shell       10240 2014-05-29 19:47 System.ServiceModel.Primitives.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Text.Encoding.Extensions.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 19:47 System.Text.Encoding.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 19:47 System.Text.RegularExpressions.dll
> -rw-rw-rw- shell    shell        5632 2014-05-29 19:47 System.Threading.Tasks.Parallel.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 19:47 System.Threading.Tasks.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Threading.dll
> -rw-rw-rw- shell    shell        6656 2014-05-29 19:47 System.Xml.ReaderWriter.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 19:47 System.Xml.XDocument.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 19:47 System.Xml.XmlSerializer.dll
> -rw-rw-rw- shell    shell        7168 2014-05-29 19:47 TodoMvvm.Android.dll
> -rw-rw-rw- shell    shell        2018 2014-05-29 19:47 TodoMvvm.Android.dll.mdb
> -rw-rw-rw- shell    shell     1504256 2014-05-29 19:47 Xamarin.Android.Support.v4.dll
> -rw-rw-rw- shell    shell      316928 2014-05-29 19:47 Xamarin.Forms.Core.dll
> -rw-rw-rw- shell    shell      123392 2014-05-29 19:47 Xamarin.Forms.Platform.Android.dll
> -rw-rw-rw- shell    shell       40448 2014-05-29 19:47 Xamarin.Forms.Xaml.dll

This is _probably_ fallout from monodroid/0a1ec041, which in turn will require re-re-verifying Bug #19282, Bug #16589, and tests/codegen. (There goes my week.)
Comment 1 Jonathan Pryor 2014-05-29 20:04:10 UTC
For comparison with Comment #0, these are the assemblies currently installed in 4.14.0:

> $ adb shell ls -l /data/data/TodoMvvm.Android/files/.__override__/
> -rw-rw-rw- shell    shell       18944 2014-05-29 20:02 QuickTodo.dll
> -rw-rw-rw- shell    shell        7347 2014-05-29 20:02 QuickTodo.dll.mdb
> -rw-rw-rw- shell    shell       15872 2014-05-29 20:02 SQLite.Net.Platform.XamarinAndroid.dll
> -rw-rw-rw- shell    shell       51200 2014-05-29 20:02 SQLite.Net.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 20:02 System.Collections.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 20:02 System.ComponentModel.dll
> -rw-rw-rw- shell    shell        4096 2014-05-29 20:02 System.Diagnostics.Debug.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 20:02 System.Dynamic.Runtime.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 20:02 System.Globalization.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 20:02 System.IO.dll
> -rw-rw-rw- shell    shell        6656 2014-05-29 20:02 System.Linq.Expressions.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 20:02 System.Linq.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 20:02 System.ObjectModel.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 20:02 System.Reflection.Extensions.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 20:02 System.Reflection.dll
> -rw-rw-rw- shell    shell        4608 2014-05-29 20:02 System.Runtime.Extensions.dll
> -rw-rw-rw- shell    shell       12288 2014-05-29 20:02 System.Runtime.dll
> -rw-rw-rw- shell    shell        6144 2014-05-29 20:02 System.Threading.Tasks.dll
> -rw-rw-rw- shell    shell        5120 2014-05-29 20:02 System.Threading.dll
> -rw-rw-rw- shell    shell        7168 2014-05-29 20:02 TodoMvvm.Android.dll
> -rw-rw-rw- shell    shell        2018 2014-05-29 20:02 TodoMvvm.Android.dll.mdb
> -rw-rw-rw- shell    shell     1504256 2014-05-29 20:02 Xamarin.Android.Support.v4.dll
> -rw-rw-rw- shell    shell      316928 2014-05-29 20:02 Xamarin.Forms.Core.dll
> -rw-rw-rw- shell    shell      123392 2014-05-29 20:02 Xamarin.Forms.Platform.Android.dll

24 assemblies vs. 56 installed with stable.
Comment 2 Jonathan Pryor 2014-05-29 20:41:51 UTC
Fixed in monodroid/fc97da29 and monodroid-4.14-series/92e437fd.
Comment 3 Jonathan Pryor 2014-05-29 22:44:53 UTC
Sorry, I meant monodroid/acc042b2 and monodroid-4.14-series/8cd28bc2.
Comment 4 narayanp 2014-06-05 07:25:50 UTC
I have checked this issue with following builds:

X.S 5.1 (Build 386)
Git revision: 58b22671f2a21d76dda7adcd09c87865b5467fa0
X.Android 4.14.0-13

I am successfully able to run application on device using command. I am looking for PCLv2 facade assemblies. But I am not able to access data of application using adb shell. it is showing me opendir failed, Permission denied. I have googled it and tried to make this root access but no success. This is the gist of the terminal output: https://gist.github.com/saurabh360/8a3dc4cebde72077d617

Please look into it and let me know how can I find all assemblies of the application?
Comment 5 Jonathan Pryor 2014-06-05 11:17:07 UTC
@naranp: You have a space in your path name. Compare:

/data/data/TodoMvvm.Android/files/ .__override__/
/data/data/TodoMvvm.Android/files/.__override__/

The former is what you have, the latter is what you need.
Comment 6 Ram Chandra 2014-07-04 14:03:25 UTC
I tried to verify this issue. I am able to build and deploy the application on device using the command mentioned in bug description. 

Now I just want to verify that "PCLv2 facade assemblies are present in the fastdev directory". So I try to run the following command on terminal

"/Users/jatin66/Desktop/Backup/android-sdk-macosx/platform-tools/adb shell ls -l /data/data/TodoMvvm.Android/files/.__override__/"

but this command doesn't return anything. So I try the following command

"sudo ./adb shell ls -l"

and the output of following command is 

drwxr-xr-x root     root              2014-07-02 12:47 acct
drwxrwx--- system   cache             1970-01-01 05:30 cache
dr-x------ root     root              2014-07-02 12:47 config
-rw-r--r-- root     root         1399 1970-01-01 05:30 cwkeys
lrwxrwxrwx root     root              2014-07-02 12:47 d -> /sys/kernel/debug
drwxrwx--x system   system            2014-07-02 16:30 data
-rw-r--r-- root     root          118 1970-01-01 05:30 default.prop
drwxr-xr-x root     root              2014-07-04 00:13 dev
drwx------ root     root              2014-07-04 22:57 devlog
lrwxrwxrwx root     root              2014-07-02 12:47 etc -> /system/etc
-rwxr-x--- root     root       111620 1970-01-01 05:30 init
-rwxr-x--- root     root         9614 1970-01-01 05:30 init.bliss.rc
-rwxr-x--- root     root         2344 1970-01-01 05:30 init.goldfish.rc
-rwxr-x--- root     root         9614 1970-01-01 05:30 init.primou.rc
-rwxr-x--- root     root        21851 1970-01-01 05:30 init.rc
-rwxr-x--- root     root         7760 1970-01-01 05:30 init.usb.rc
drwxrwxr-x root     system            2014-07-02 12:47 mnt
dr-xr-xr-x root     root              1970-01-01 05:30 proc
drwx------ root     root              2014-04-07 21:50 root
drwxr-x--- root     root              1970-01-01 05:30 sbin
lrwxrwxrwx root     root              2014-07-02 12:47 sdcard -> /mnt/sdcard
drwxr-xr-x root     root              2014-07-02 12:47 sys
drwxr-xr-x root     root              2014-07-02 12:45 system
-rw-r--r-- root     root          272 1970-01-01 05:30 ueventd.goldfish.rc
-rw-r--r-- root     root         1348 1970-01-01 05:30 ueventd.primou.rc
-rw-r--r-- root     root         7884 1970-01-01 05:30 ueventd.rc
lrwxrwxrwx root     root              2014-07-02 12:47 vendor -> /system/vendor

Could you please provide me some suggestion so that I can verify this issue?

Environment Info:

=== Xamarin Studio ===

Version 5.1 (build 479)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.4.0 ((no/63569a7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000205

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Version: 1.8.0.8

=== Xamarin.Android ===

Version: 4.14.0 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
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.iOS ===

Version: 7.2.5.5 (Business Edition)
Hash: 87026b6
Branch: 
Build date: 2014-07-02 19:39:08-0400

=== Build Information ===

Release ID: 501000479
Git revision: e5a428cec75d4cc7e6e3ccd8192a3660d013e7dc
Build date: 2014-06-26 09:28:17-04
Xamarin addins: 190d93e026e17280e75a3680ef38f2630b9228d3

=== Operating System ===

Mac OS X 10.9.3
Darwin Jatin66s-iMac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 7 Peter Collins 2014-07-07 16:42:33 UTC
Took a bit of digging, as the new fastdev location varies on each device.
We're back to the expected 56 installed assemblies and the app successfully runs:

https://gist.github.com/pjcollins/5dd3535c0959ce641f6d
Comment 8 Ram Chandra 2014-08-05 10:25:30 UTC
As per Comment 7, this issue has been fixed.

Hence, I am closing this issue.