Showing posts with label error MSB6004. Show all posts
Showing posts with label error MSB6004. Show all posts

Saturday 4 October 2014

\adt-bundle-windows-x86_64-20130219\sdk\platform-tools\aapt.exe is invalid

When your are using Android with Csharp or when you are using Monoandroid you will be facing some some error related to aapt.exe missing or aapt.exe invalid . These are common error to Monoandroid developer that almost every one that uses Monoandroid will face .

So Today I decided to get the actual reason of this problem and I sit on my chair to find out the reason and possible solution to this error that may work for everyone . I suffered from this error number of times before but i tried the ways to get rid of it But not today this is the day to get solution of this error .

What are Possible Errors :



  • Error MSB6004: The specified task executable location "C:\Program


  • Files\adt-bundle-windows-x86_64-20130219\sdk\platform-tools\aapt.exe" is 


invalid. (MSB6004) (TaskyAndroid)

The specified task executable location "D:\android-sdk\platform-tools

\aapt.exe" is invalid.


Reason of Above Errors 




This issue is caused by Google changing around the directory structure of the Android SDK with their latest updates and due to these updates old directory structures are creating problem Most probably these error comes after you update your android So when you update your android-sdk then it update the directory structure of android-sdk to new structure of google that allows
aapt.exe to be must present in android-sdk/platform-tools/ but that will be not there because in old directory structure that monoandroid is using aapt.exe is in android-sdk/build-tools/ that's why this error is coming and MonoAndroid Team is applying these changes so  before that we need to figure out this issue to continue our development

Error Solution aapt.exe Invalid


Steps :-

1.  Copy the aapt.exe file from folder \android-sdk\build-tools\17.0.0 to \android-sdk\platform-tools . Here 17.0.0 is your android api you have installed in your sdk it will be what version you installed like :- 8.0.0, 18.0.0

2. Now Also Copy \android-sdk\build-tools\17.0.0\lib folder to \android-sdk\platform-tools\ As there is a file in that directory dx.jar which is also Needed by xamarin

3. Now Everything will be fine ........Cheers!


There is one more error which can let you suffer it is :-

java exited with code 1


Reason of Error java exited with code 1

The reason of this error is in our previous error solution When you copy the aapt.exe file from  \android-sdk\build-tools\17.0.0 to \android-sdk\platform-tools .  and forger to copy or don't copy folder  \android-sdk\build-tools\17.0.0\lib folder to \android-sdk\platform-tools\ then this error comes this is main reason of this error

Error Solution java exited with code 1



 Also Copy \android-sdk\build-tools\17.0.0\lib folder to \android-sdk\platform-tools\ As there is a file in that directory dx.jar which is also Needed by xamarin after copying aapt.exe file