5

I just create a project and wanna build and run this in my Android phone.

Here is Normal detail of my project Output. I did not put space and dash in any of my file. while error error MSB6006: "aapt.exe" exited with code -1073741819. Display

C:\Users\DeviceBee SAQE\AppData\Local\Android\android-sdk\build-tools\21.0.1\aapt.exe
  package -f -m -M "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy
 \AndroidManifest.xml" -J "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy" 
 --custom-package app1.app1 -F "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy
  \resources.apk.bk" -S obj\Debug\res -I "C:\Users\DeviceBee SAQE\AppData\Local\Android
  \android-sdk\platforms\android-12\android.jar" --auto-add-overlay --max-res-version
   12 

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(783,2): error MSB6006: "aapt.exe" exited with code -1073741819.

chrisntr
  • 2,208
  • 20
  • 28
Arsal
  • 343
  • 2
  • 8
  • 21
  • Did you do some google research for "MSB6006 exited with code -1073741819"? – Tomáš Knopp Nov 13 '14 at 10:53
  • Yes I did. I got solution just once. But I found again that problem and the last solution isn't working. – Arsal Nov 13 '14 at 11:09
  • possible duplicate of [AAPT failing with error code -1073741819](http://stackoverflow.com/questions/10699439/aapt-failing-with-error-code-1073741819) – JKennedy Nov 13 '14 at 11:10
  • can u please explain and tell me how to resolve.? how can I remove duplicate..? – Arsal Nov 13 '14 at 11:17
  • I have checked this before posting my question.But couldn't found any solution by applying this...@user1 – Arsal Nov 13 '14 at 11:30
  • Have you tried the latest Android SDK? According to [this comment](http://stackoverflow.com/a/26441954/1794518) - the problem should be resolved with Android SDK Build-tools rel. 21.0.2. – Tomáš Knopp Nov 13 '14 at 11:42
  • Basically @TomasKnopp I'm using xamarin for android . when I installed this was working perfect,Because Android SDK installation is in the Xamarin package. while I dont how this happened . After that in every new project,,,this error comes out. – Arsal Nov 13 '14 at 11:48
  • Do you have your updates set to Beta or Alpha channels and have you recently updated Xamarin Studio? I had this same issue yesterday, I could only fix it by swapping back to the Stable channel. – matthewrdev Nov 13 '14 at 11:51
  • @MattR Now I just checked my Xamarin Studio which is up to date. how can I swapping back to the stable channel ? I think totally is updated. – Arsal Nov 13 '14 at 11:55
  • Even though you are using Xamarin you can install the latest Android SDK Build-tools rel. 21.0.2 yourself using the Android SDK Manager. Another possibility is to fix the source of the problem which seems to be some invalid filename format in resource files of the project. – Tomáš Knopp Nov 13 '14 at 11:55
  • @TomasKnopp Now I'm installing latest Android SDK Build tools. 21.0.2 . More is that how can i create my resource file from scratch . I mean if old one have such problems then the new one should not have.? what you say – Arsal Nov 13 '14 at 12:01
  • 1
    @Arsal You can swap channel using this tutorial: http://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/ – matthewrdev Nov 13 '14 at 12:03
  • Swapped channel to Beta. and Xamarin is updating ....may I think that this issue would resolve.? – Arsal Nov 13 '14 at 12:07
  • @Arsal Dunno I am not much into the Xamarin Android myself. But I'd recommend first trying if the SDK update helps and if not then look further into the issue. – Tomáš Knopp Nov 13 '14 at 12:18
  • 1
    I think this is the issue with the latest beta Xamarin.Android. It manifests when 3rd party assemblies are referenced (possible when those are based on jars). Bugzilled issue 24409 [https://bugzilla.xamarin.com/show_bug.cgi?id=24488] – Miha Markic Nov 13 '14 at 12:20
  • 1
    After Xamarin Updating through Beta swapping I am able to get rid of that bloody Error :) THANK you Guys – Arsal Nov 13 '14 at 12:58
  • What version exactly are you using now? – Miha Markic Nov 13 '14 at 13:46
  • 3.7 something of Xamarin Version..... Guys @MattR I got again that error.... ahhhh... ! I couldn't got proper solution. I think updating software was not a proper solution to get rid of this Error...! – Arsal Nov 14 '14 at 08:02

2 Answers2

2

Adding TechNote link - Remove SDK 24 using the Android SDK Manager is the solution as noted by @ali. Technote on this exact issue here - https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/ . Totally removing "24" from my machine cleared it. Just changing targets did not.

Joe Healy
  • 5,769
  • 3
  • 38
  • 56
1

I have some problem ,after this, i read output error see this:

   I:\Program Files\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe package -f -m -M obj\Debug\android\manifest\AndroidManifest.xml -J "C:\Users\Ali Visual Studio\AppData\Local\Temp\5q0cnsx0.m3e" --custom-package app3.app3 -F obj\Debug\android\bin\packaged_resources.bk -S obj\Debug\res -I "I:\Program Files\Android\android-sdk\platforms\android-10\android.jar" --auto-add-overlay --max-res-version 10  (TaskId:200)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1698,3): error MSB6006: "aapt.exe" exited with code -1073741819.
1>Done executing task "Aapt". (TaskId:200)
1>Task "Touch" (TaskId:201)
1>  Task Parameter:Files=obj\Debug\android\bin\packaged_resources (TaskId:201)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1724,3): error MSB3375: The file "obj\Debug\android\bin\packaged_resources" does not exist.
1>Done executing task "Touch" -- FAILED. (TaskId:201)
1>Done building target "_CreateBaseApk" in project "App3.csproj" -- FAILED.: (TargetId:130)

Ok this line is my problem:

I:\Program Files\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe

go to your your android build-tools installed path and check your build-tools versions, you can update build-tools from Android SDK Manager or remove version if has error, i have build-tools 23.0.1 and 23.0.2 and 24.0.0-preview (default build version is latest 24.0.0-preview) i removed 24.0.0-preview folder and rebuild my project and it's works.

Ali Yousefi
  • 2,355
  • 2
  • 32
  • 47