1
votes

I am working on xamarin for android application in visual studio 2010. whenever i run my emulator it shows two errors and not compile my application

Error 1 Access to the path 'resources.apk.bk' is denied.
Error 2 The directory is not empty.

and Exception

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;MOBILE;ANDROID;ANDROID_1;ANDROID_2;ANDROID_3;ANDROID_4;ANDROID_5;ANDROID_6;ANDROID_7;ANDROID_8;ANDROID_9;ANDROID_10;ANDROID_11;ANDROID_12;ANDROID_13;ANDROID_14;ANDROID_15;ANDROID_16;ANDROID_17;ANDROID_18;ANDROID_19 /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.4\Mono.Android.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\HelloWorldXamarin.dll /target:library /utf8output MainActivity.cs Resources\Resource.Designer.cs Properties\AssemblyInfo.cs "C:\Users\Dhaval\AppData\Local\Temp\MonoAndroid,Version=v2.2.AssemblyAttributes.cs" obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs HelloWorldXamarin -> c:\users\dhaval\documents\visual studio 2010\Projects\HelloWorldXamarin\HelloWorldXamarin\bin\Debug\HelloWorldXamarin.dll C:\Program Files (x86)\Java\jdk1.6.0_39\bin\jarsigner.exe -keystore "C:\Users\Dhaval\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\HelloWorldXamarin.HelloWorldXamarin-Signed-Unaligned.apk obj\Debug\android\bin\HelloWorldXamarin.HelloWorldXamarin.apk androiddebugkey The specified task executable location "C:\Users\Dhaval\AppData\Local\Android\android-sdk\tools\zipalign.exe" is invalid. Build FAILED.

1

1 Answers

0
votes

Right, I'm certainly no expert here but I did have the same problem and I did seem to find a solution.

The very last part of your error

C:\Users\Dhaval\AppData\Local\Android\android-sdk\tools\zipalign.exe" is invalid.

comes from the install of Xamarin itself I believe. What you need to do, is locate this file (quite possibly found within a particular sdk build but I found it just by searching my C drive) and copy it into the tools folder that is listed above where the emulator is expecting to find the file. You should find that if you look there just now, it doesn't actually exist in there yet and that would have a serious impact in your ability to compile packages.

I hope this helps you to solve your issue, and please let me know if this works out for you!