Bug 23753 - Building a project with read-only Resource file leads to a generic MSBuild error
Summary: Building a project with read-only Resource file leads to a generic MSBuild error
Status: RESOLVED DUPLICATE of bug 23653
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.18.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2014-10-10 20:09 UTC by Juro
Modified: 2014-10-14 08:20 UTC (History)
3 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:
RESOLVED DUPLICATE of bug 23653

Description Juro 2014-10-10 20:09:46 UTC
As we are using the TFS, the source files which are not checked out has no write permission on Mac. The v4.18 compiler cannot compile the project unless I give the write permission to all files in Resources folder.
The error message is:
MyProject.csproj(1,1): Error: Unknown MSBuild failure. Please try building the project again (MyProject)

The Build Output is more expressive:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Error executing task CopyAndConvertResources: Access to the path "/Users/juro/Work/MyProject/MyProject/obj/Debug/res/drawable-hdpi/icon.png" is denied.
: error : Error building target _GenerateAndroidResourceDir: Object reference not set to an instance of an object
Comment 1 Sadik Ali 2014-10-13 06:48:42 UTC
I have checked this issue and able to reproduce reported behavior. To reproduce this issue I have followed steps mentioned below:

1. Create an android application
2. Right click on Resources folder choose open containing folder
3. Make Readonly to Icon.png, Main.axml, Strings.xml under drawable, layout, values folder  Respect. 
4. Rebuild the application and you will get the following error: 

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task CopyAndConvertResources: Access to the path "/Users/MM/Projects/Bug_23753/Bug_23753/obj/Debug/res/layout/main.xml" is denied. (Bug_23753)

5. Again make Read & Write to Icon.png, Main.axml, Strings.xml files
6. Rebuild the application and observe that it will build successfully.

Please let me know the is this the same behavior/error you are experiencing, shown in the screencast ? If no then could you please provide us steps/small sample application to reproduce this issue. That will be helpful to reproduce this issue at our end.

Screencast: http://www.screencast.com/t/xhc0BOp0q70t

Environment Info:

=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.10.0 ((detached/47db868)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000019

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Version: 1.10.0.13 (Starter Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		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)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.2.0.193 (Enterprise Edition)
Hash: 959c1e4
Branch: 
Build date: 2014-10-03 00:25:37-0400

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Jonathan Pryor 2014-10-13 10:31:53 UTC
@dellis: Could you please investigate this? It *looks* like it should be a dupe of Bug #23653, except this bug involves a NullReferenceException, which is weird.
Comment 3 Juro 2014-10-14 05:37:19 UTC
Sadik: Yes, That's it.

Jon: It looks like the same issue, but it's not fixed in 4.18. I'm not sure about earlier versions (I've jumped from the 4.12 to 4.18 because of the Profiler & Android Player - BTW: GOOD JOB).

This is my environment:
Xamarin Studio
Version 5.6 (build 273)
Installation UUID: ae320932-d643-493d-bc90-afeb5e20e5c9
Runtime:
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

Apple Developer Tools
Xcode 6.0 (6299)
Build 6A313

Xamarin.iOS
Version: 8.2.0.193 (Business Edition)
Hash: 959c1e4
Branch: 
Build date: 2014-10-03 00:25:37-0400

Xamarin.Android
Version: 4.18.0 (Business Edition)
Android SDK: /Users/juro/Library/Developer/Xamarin/android-sdk-macosx
	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.3 (API level 15)
		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)

Xamarin.Mac
Version:

Build Information
Release ID: 506000273
Git revision: 4fdf44df17d841e324e22b99c0e4671360036dfd
Build date: 2014-10-07 18:16:52-04

Operating System
Mac OS X 10.9.5
Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 4 Rajneesh Kumar 2014-10-14 06:57:01 UTC
We have reproduced this issue in comment 1 and we also get confirmation of this issue in comment 3. So behalf on this changing its status needinfo to confirmed.
Comment 5 dean.ellis 2014-10-14 08:20:12 UTC
I have tested this on the latest master builds and I do not get the same issue. This is due to the fix for 23653 which is in master. So I am resolving this as a duplicate bug

*** This bug has been marked as a duplicate of bug 23653 ***