Bug 18490 - Mono for Android Compilation Error
Summary: Mono for Android Compilation Error
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.10.0.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2014-03-20 06:55 UTC by Sreeni
Modified: 2017-06-27 00:18 UTC (History)
3 users (show)

Tags: bb
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:

Description Sreeni 2014-03-20 06:55:38 UTC
Hi, i am working on android application, my App using iTextSharp library (which is added as monoandroid library to my app and the reference of iTextSharp is added to my 'ProjectXYZ' which is startup project of my app),For reading the files i moved some files like 'en.lng'..etc to "Assets" folder of my startup project from iTextSharp. When i am trying to compile the application i am getting the following compilation error.

Error 36 Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.UnauthorizedAccessException: Access to the path "C:\SampleProject\ProjectXYZ\obj\Debug__library_projects__\iTextSharpLibrary\library_project_imports\assets\en.lng" is denied. ProjectXYZ

In the output window it's showing this line when i rebuild. C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (1462,42): Access to the path denied 'en.lng'

I tried unchecking the "Read Only" option in file properties by opening the file in windows explorer, but of vain.


If i am deleting the obj\debug folder and running the application it's going to compile and installed successfully on to device.

Every time when i open the solution after deleting the "debug" folder only its compiling and loading to device. This is a painful.

So can you please suggest me how to comeout of this issue.

Thanks in advance
Comment 1 Udham Singh 2014-03-20 09:31:44 UTC
I have checked this issue but not able to reproduce it. To reproduce this issue I have followed the steps below:

1. Create an "Android Library Project" named iTextSharpLibrary.
2. Add iTextSharp dll reference to the iTextSharpLibrary project.
3. Add "en.lng" file to the iTextSharpLibrary project and bulid iTextSharpLibrary project.
4. Create an "Android Application" named ProjectXYZ.
5. Add iTextSharpLibrary project reference into ProjectXYZ.
6. Move "en.lng" from iTextSharpLibrary project to ProjectXYZ under "Assets" folder.
7. Set ProjectXYZ as start-up project and on build the application, it got build successfully

Screencast: http://screencast.com/t/HwBn67VC8RV0

Environment Info: 

Windows 8.1
XS 4.2.3 (build 60)
Xamarin.Android 4.10.2/4.12.2

Please let me know if I am missing any steps.
Comment 2 Sreeni 2014-03-24 10:00:48 UTC
Hi udham, 
Thanx for your respose. iTextSharp android library here means it's a thridparty library that contains some hundreds of files for creating pdfs. I can't send you that libray bcz of privacy. if possible i will send you a screencast.
Comment 3 Chris Hardy [MSFT] 2017-06-26 17:52:41 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please reopen this issue and attach a reproduction to the bug by starting with a clean Xamarin.Android project adding just the code necessary to demonstrate the issue.