Bug 20937 - Xamarin Studio (commercial) does not allow to build sample Xamarin.Forms project
Summary: Xamarin Studio (commercial) does not allow to build sample Xamarin.Forms project
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.12.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2014-06-27 04:58 UTC by Sergey Zhukov
Modified: 2017-06-28 18:55 UTC (History)
6 users (show)

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

compilation errors (98.75 KB, text/plain)
2014-06-27 05:04 UTC, Sergey Zhukov
compilation errors (diagnostic log) (1021.78 KB, text/plain)
2014-07-02 07:51 UTC, Sergey Zhukov
Xamarin Studio logs (19.53 KB, application/zip)
2014-07-02 07:58 UTC, Sergey Zhukov

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:

Description Sergey Zhukov 2014-06-27 04:58:23 UTC
OS: Windows 7. Product: Xamarin Studio 5.0.1

I tried to install evaluation of commercial Xamarin Studio, build sample projects and encountered several bugs which prevent me to build me sample Xamarin.Forms project. I decided to write all of them here, because this is user experience of new user who tried to use Xamarin Studio.

1. Xamarin Studio does not install all required prerequisites. It must install all required .NET profiles for PCL project, even if Microsoft installer does not install them and just extracts zip file. Not all users have got Visual Studio 2013 with PCL support and Xamarin Studio must not oblige these users to search missing components and manually copy files. Without these perequisites Xamarin.Forms project cannot be built.

Required steps to install prerequisites are posted here: http://forums.xamarin.com/discussion/comment/40244/#Comment_40244

    Install PLT2
    Install PLRA
    Extract the PLRA PortableReferenceAssemblies.zip (from C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6\PortableReferenceAssemblies.zip) into the PCL reference assemblies directory C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable.

2. I could not build project located at non-ASCII path and have to copy them to another place. There is already the bug in bugzilla about this, but I mentioned it here, because the bug blocks building app for non-US users who has windows user name containing national chars. Also, I've seen couple of places in Xamarin Studio where these paths showed incorrectly.

3. When I create sample Android project (without Xamarin.Forms) and run it I see all emulator devices in the list with red cross and error says "config.ini could not be parsed". To fix it I have to click "edit" button and without changing anything click "Edit AVD" button. This should work out of the box, without additional steps from user.

4. When I create sample Xamarin.Forms project I can't build it because I've got "mandroid error" and then "NullReferenceException". Logs are attached

5. When I tried to log into Xamarin account from Xamarin Studio, I got several times the error message says that I must have the internet connection. But I have a very good internet connection, and this error looking weird. If server was down it should say, that server is temporary down, please try later. Or if server could not process the login request in given timeout time, timeout should be increased. I could login only after 5th attempt.

6. I could not activate Trial Period from web or from Xamarin Studio without building the application. But because build throws an NullReferenceException I could not activate it at all. There should be the option to activate trial without building the project.   

I spent the most part of the day with fresh install of commercial release of Xamarin Studio trying to run "Hello, World" Xamarin.Forms project, and still not have the ability to compile it. The bugs I've met are on the top and could be easily catched. I think you should create QA team which tests the commercial builds before publishing it. If you have the QA team, please add the following test cases to test matrix:

[Windows 7, Windows 8] x [Visual Studio [2010x2012x2013] installed, Visual Studio not installed] x [WinPhone SDK installed, WinPhone SDK not installed] x [Create and run Android application, Create and Run WinPhone application, Create and run Xamarin.Forms application] x [User has xamarin account, user does not have xamarin account] x [US windows, any other language localized windows]
Comment 1 Sergey Zhukov 2014-06-27 05:04:39 UTC
Created attachment 7212 [details]
compilation errors
Comment 2 Jonathan Pryor 2014-07-01 18:09:33 UTC
> 2. Building in non-ASCII paths.

Building in non-ASCII paths is only part of the problem. The other part of the problem is that the Android SDK itself doesn't like (or support) being installed into a location with non-ASCII characters:


Fixing the Android SDK is "outside" the scope of our product. Unfortunately Xamarin does pick where it's installed, and we picked somewhere within %USERPROFILE%, which means we've deliberately picked a location which will do maximum damage, but this was chosen so as to avoid Administrator permission to install elsewhere. I'm not sure what the correct answer is.

Now, if the Android SDK is installed in a location from which it can actually run (i.e. not in %USERPROFILE%), and Xamarin.Android still fails to build projects, that is in-scope. (Unfortunately, there's still at least one of those bugs hanging around...)

> 4. I can't build.

Please provide diagnostic build output:


My initial guess is that you still need to login (Tools > Account...), and that your machine is configured with a Starter license.

> 5. When I tried to log into Xamarin account from Xamarin Studio,

This suggests that you in fact haven't logged in, which would explain (4).

It is possible that your machine doesn't trust the SSL certificate that our activation server provides. Is there some "Untrusted HTTP certificate detected" message that you could accept?
Comment 3 Mikayla Hutchinson [MSFT] 2014-07-01 18:15:59 UTC
1. Very sorry about that. Unfortunately we are not able to install the PCL assemblies and build targets on Windows because it could conflict with VS - and MS has not updated their standalone PCL installer in some time. The easiest path to installing the PCL assemblies on Windows is probably to install a VS2013 trial.

Note that if you installed the PCL assemblies after running the Xamarin installer, you need to (re)install the Xamarin msi, so it can mark them as compatible with Xamarin frameworks. To do this, uninstall Xamarin from Add/Remove programs, and run the universal installer again. You can tell when everything's installed correctly because all the profiles and frameworks will show up in the framework selector in Project Options of PCL projects.

2. Yes, we've been tracking this for a while as bug 14918. I believe there were some difficulties in fixing it, which is why it hasn't been resolved yet. I hadn't heard of those corrupted paths showing up in Xamarin Studio though - where did you see them?

3. That's strange, I haven't seen that before. Do you happen to have a copy of the old config.ini?

4. That's the biggest issue here, which is why I've assigned this to the Android product, since the NRE is what's blocking you from progressing.

5. Could you please attach the log file (Help->Open log directory)? It should have more information about the internet errors.

6. We do have a bug open for the option to manually start a trial - but starting a trial wouldn't do much good when you can't build.

I'm not sure exactly what our QA test matrix is - is pretty big, but I don't think it includes the manual installation of the PCL profiles. I suspect that may be the root cause here.
Comment 4 Sergey Zhukov 2014-07-02 07:51:24 UTC
Created attachment 7262 [details]
compilation errors (diagnostic log)
Comment 5 Sergey Zhukov 2014-07-02 07:58:09 UTC
Created attachment 7263 [details]
Xamarin Studio logs
Comment 6 Sergey Zhukov 2014-07-02 08:19:56 UTC
I added the build logs and Xamarin Studio logs. 
Unfortunatelly the logs when I could not login to Xamarin Account from the Xamarin Studio had been removed with AppData folder by me when I reinstalled Xamarin Studio last time. Now I am logged into Xamarin Account. It was definitely not SSL issue because I did not install any other software or did any other fixes between unseccessfull and succsessfull logins to the account.
Also I did not save old config.ini files. 

But there is an IndexOutOfRange exception in activation system in the logs, I hope this will help to resolve NullReferenceException.
Comment 7 Marek Habersack 2014-07-02 08:52:07 UTC
The problem with the Android SDK installation is that we use the self-extractable archive which is built using NSIS but it ignores the /D swich which defines the destination (at least that's how it was the last time I tested last year). The script itself is not available publicly so I can't confirm the suspicion. The sfx seems to have its own variable which by default points to the user's home as the destination and the user can override it during interactive installation, but we cannot change the default when invoking the installer in silent mode.
The alternative (and we used it in the past) is to use the .zip archive to bootstrap the SDK but the worry there is that if Google change the default location or the registry keys they might be writing the user might end up with an invalid installation.
Comment 8 Jonathan Pryor 2014-07-02 10:24:14 UTC
@svg: Thank you for the diagnostic build output in Comment #4. The XA0000 error appears to be Bug #18134, and should be fixed in the 4.14 series.
Comment 9 Sergey Zhukov 2014-07-02 12:30:29 UTC
Jonathan, I don't have access to see that bug. Is there a way to workaround it in Xamarin.Android 4.12.5?
Comment 10 Sergey Zhukov 2014-07-02 12:37:29 UTC
Michael, why not to check if Visual Studio 2013 is installed and if not installed proceed with installation of PCL libraries?
Comment 11 Jonathan Pryor 2014-07-02 13:15:36 UTC
@svg: The quick workaround is to not use Starter edition. ;-)

(Which would actually be viable if you were able to register.... :-(
Comment 12 Mikayla Hutchinson [MSFT] 2014-07-02 18:06:57 UTC
Looking into the IndexOutOfRangeException. FWIW you should also be able to trigger a trial by adding a reference to WCF (System.ServiceModel).
Comment 13 Mikayla Hutchinson [MSFT] 2014-07-02 18:08:04 UTC
Maybe we could install PCL if VS is not installed - Marek, any thoughts on this?
Comment 14 Mikayla Hutchinson [MSFT] 2014-07-02 18:58:07 UTC
It looks like the IndexOutOfRangeException is an encoding issue, we're not able to parse the error because of bad text decoding:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(182,5): mandroid error XA9005: User code size, 1992686 bytes, is larger than 65536 and requires a Indie (or higher) License.
Comment 15 Mikayla Hutchinson [MSFT] 2014-07-02 19:09:20 UTC
I have filed bug 21068 for the output/error encoding issue.
Comment 16 Marek Habersack 2014-07-03 02:39:30 UTC
(In reply to comment #13)
> Maybe we could install PCL if VS is not installed - Marek, any thoughts on
> this?

Not against the idea. The only unknown is - what happens if we install the PCL and the user installs any VS on top of it later on? Will that work?
Comment 17 Mikayla Hutchinson [MSFT] 2014-07-03 13:00:54 UTC
@Marek: If we just run the MS VS2010 PCL2 installer  with the /buildmachine switch, I can't see it'd be a problem. Extracting the newer PCL assemblies into place might be an issue though.
Comment 18 Marek Habersack 2014-07-03 18:15:48 UTC
@Michael: can you investigate whether extracting the newer profiles would be a problem? I'm a bit tied up atm... Thanks!
Comment 19 Mikayla Hutchinson [MSFT] 2014-07-03 20:38:41 UTC
@Marek: I have no idea, we'd have to check with the VS guys
Comment 20 Tom Opgenorth 2017-06-28 18:55:25 UTC
Cannot seem to duplicate this issue - Xamarin Studio for Windows is no longer supported. If this is still a problem with Visual Studio, please reopen this bug and attach a sample project that reproduces the error.