Error MSB4018: The "ConvertResourcesCases" task failed unexpectedly.

keep getting this error message? why???????? crack my head....

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error MSB4018: The "ConvertResourcesCases" task failed unexpectedly.
System.UnauthorizedAccessException: Access to the path 'obj\Debug\res\layout\adpara.xml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
at Xamarin.Android.Tools.Files.CopyIfChanged(String source, String destination)
at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources(ITaskItem item, Dictionary2 acwMap) at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources(Dictionary2 acwMap)
at Xamarin.Android.Tasks.ConvertResourcesCases.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() (MSB4018) (M-ERP)

Tagged:

Answers

  • ChrisChanChrisChan MYMember

    why no one answering. till now i still can not build the damm sulotion.

  • I also having this problem. No one in xamarin forum know this problem?

    BUMP BUMP.

  • ChrisChanChrisChan MYMember

    i fund the problem, make sure u file is "unblock" under the file property.

  • THISSSSSS!!!!! Thanks man!!!!!

  • BingoBingo USMember

    @Chrischan, even am facing the same problem. However didn't understand your solution of File "Unblock". Do you mean remove ReadOnly checkmark? if so i have already done that for entire "obj" and "bin" folder hierarchy, however still facing the same problem. If it was something else then pls let me know.

    I get this build error for a lot of Xamarin sample projects.

    @XamarinSupportTeam, kindly look into this ASAP.
    My Environment Details:
    Xamarin Studio version: 5.9.5 (Build 23)
    Sample Projects: GooglePlayServices, API Demo
    OS: Windows 8.1
    Platform: Android

  • JSparrowJSparrow USMember

    My path file path was C:\Users\NewUser\Documents\Projects

    I changed it to

    c:\Projects

    it worked.

  • KorayemKorayem EGMember ✭✭

    @bingo I finally fixed this. I went to root folder, right click and open "Get Info" then added "READ & WRITE" permission to "everyone" and pressed "Apply to enclosed items.." (you'll need to unlock admin lock at bottom right corner)

  • I just had the same problem. The fix was add "READ & WRITE" and **rebuild **the project.

  • VicJVicJ MYMember ✭✭
    edited January 2016

    @SalemKorayem said:
    @bingo I finally fixed this. I went to root folder, right click and open "Get Info" then added "READ & WRITE" permission to "everyone" and pressed "Apply to enclosed items.." (you'll need to unlock admin lock at bottom right corner)

    Sorry where do I find the "Get Info"? Is it via File Explorer because I don't see any "Get Info" in the properties. In Xamarin Studio, I also do not see "Get Info" under the Options menu

  • MADHUKOREPUMADHUKOREPU USMember

    Hello:

    Could you please help to fix this below issue, your reply much appropriated!!!

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: The "ConvertResourcesCases" task failed unexpectedly.
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at System.IO.Path.GetDirectoryName(String path)
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Xamarin.Android.Tools.Files.CopyIfChanged(String source, String destination)
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources(ITaskItem item, Dictionary2 acwMap) C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources(Dictionary2 acwMap)
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Xamarin.Android.Tasks.ConvertResourcesCases.Execute()
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1201,2): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

    7 Warning(s)
    
    1 Error(s)
    

    Thanks,
    -Madhu.

  • KorayemKorayem EGMember ✭✭

    @VicJ said:

    @SalemKorayem said:
    @bingo I finally fixed this. I went to root folder, right click and open "Get Info" then added "READ & WRITE" permission to "everyone" and pressed "Apply to enclosed items.." (you'll need to unlock admin lock at bottom right corner)

    Sorry where do I find the "Get Info"? Is it via File Explorer because I don't see any "Get Info" in the properties. In Xamarin Studio, I also do not see "Get Info" under the Options menu

    Sorry I was referring in case you're on OSX. In your case on Windows, check READ/WRITE security permissions of the same folder.

  • TayfunztrkTayfunztrk USMember

    The reason is the Non-English Character.
    Check your project location. If the path is including Non-English Character change it to English.I mean it is encoding problem. For example , I had got Turkish character "ö" and xamarin couldn't recognize and i change it to "o".

  • VicJVicJ MYMember ✭✭

    @Tayfunztrk said:
    The reason is the Non-English Character.
    Check your project location. If the path is including Non-English Character change it to English.I mean it is encoding problem. For example , I had got Turkish character "ö" and xamarin couldn't recognize and i change it to "o".

    How about non alphanumeric characters such as dots or hypens?

  • VicJVicJ MYMember ✭✭
    edited March 2016

    OK I finally figured it out. For the benefit of those encountering the same problem here's how I fix it. Yes it's caused by any non English character in the root folder.

    For example my original solution location is

    D:\Users\OneDrive\Dev\Xamarin\TekaTeki3\TekaTeki3\

    I created a new folder and rename the folder from TekaTeki3 to TekaTekiTiga. Now it compiles properly!

    D:\Users\OneDrive\Dev\Xamarin\TekaTekiTiga\TekaTeki3\

  • VolodymyrSavchenkoVolodymyrSavchenko UAMember ✭✭✭

    Remove bin and obj folders.

  • Richy_GeorgeRichy_George INMember ✭✭✭

    I also encounter this error, may be of a change in file path; Fixed by "Rebuild"ing the project.

  • AlicanKaramilAlicanKaramil USMember

    @VolodymyrSavchenko said:
    Remove bin and obj folders.

    Thanks this actually worked

  • SumitPathakSumitPathak INMember ✭✭

    @VolodymyrSavchenko said:
    Remove bin and obj folders.

    Work for me

  • MilkBiscuitMilkBiscuit Member

    It's been THREE YEARS I CAN NOT BELIEVE they still did not fix it!!!!
    Have the same problem.

    Remove bin and obj folders can work but I can not keep removing it every time I face this issue because it HAPPENS A LOT EVERY DAY!!!!!!!

  • pranay99pranay99 Member ✭✭

    I am also getting the same error. This is very annoying and frustrating one. None of the answers seems to be working, All answers are just trials, if it works then the solution is good, if doesn't you are on for great waste of time. Kudos to Visual studio and Xamarin

  • JustinTothJustinToth USMember ✭✭

    Same error 3 years later, someone should really fix this bug. We shouldn't have to clean, close and reopen visual studio, etc... every 15 minutes to work around the Xamarin bugs.

      /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018: The "ConvertResourcesCases" task failed unexpectedly.
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018: System.IO.IOException: Could not create file "obj/Debug-Dev/res/layout/accountsignupstep1invalidtoken.xml" or "/var/folders/j6/3x9csltd1qz9c3tyw84wg4_80000gn/T/tmp65fe858.tmp". File already exists.
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00193] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/File.cs:111 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources (Microsoft.Build.Framework.ITaskItem item, System.Collections.Generic.Dictionary`2[TKey,TValue] acwMap) [0x00204] in <0669e22a1ea34a33ae956490b400f14d>:0 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at Xamarin.Android.Tasks.ConvertResourcesCases.FixupResources (System.Collections.Generic.Dictionary`2[TKey,TValue] acwMap) [0x0000f] in <0669e22a1ea34a33ae956490b400f14d>:0 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at Xamarin.Android.Tasks.ConvertResourcesCases.Execute () [0x000a7] in <0669e22a1ea34a33ae956490b400f14d>:0 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:573 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1689,2): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:784 
    
Sign In or Register to comment.