"aapt.exe" exited with code -1073741819

I have been searching and searching for an answer without success. If I create a new, blank Android project using Visual Studio, then compile three errors show up:

Error "aapt.exe" exited with code -1073741819. App1 C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1183

Error "aapt.exe" exited with code -1073741819. App1 C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1665

Error The file "obj\Debug\android\bin\packaged_resources" does not exist. App1 C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1691

I have searched Google for days and haven't found anything. Anybody have an idea?

Answers

  • YkshLeoYkshLeo ✭✭✭✭ USMember ✭✭✭✭

    You probably have an invalid character in you manifest file or one of your resources has an invalid character in its name. File names can't contain '-'

    The full error message is included in the text file you provided, you need to review it. also take a look at this topic as there maybe an error in the generated manifest file.

  • QuarterHorsesQuarterHorses USMember

    Thanks for adding a comment to my question, but it would be a bad day for Xamarin if it was correct. Like I said using a new blank Android template I was getting the error. This forum would be full of bug reports.

    I did finally solve my problem. This article gave a clue on a direction to go. I uninstalled the Android SDK, and then downloaded a fresh copy from Android and installed. I then installed the platform and build tools, and voila, no more error.

  • noushadnoushad INMember

    Hi! Quarter Horses

    me too got the same error while building my project

    i tried what Vaikesh K P said but it doesn't work

    if any idea about getting rid of it is better

  • chrissolutionschrissolutions NZMember

    I've spent nearly the past several days trying to resolve this issue. I've unloaded everything and reinstalled and still have been unable to resolve this issue:

    Severity Code Description Project File Line Suppression State
    Error "aapt.exe" exited with code -1073741819. App2
    Error The file "obj\Debug\android\bin\packaged_resources" does not exist. App2
    Error "aapt.exe" exited with code -1073741819. App2

    I'm just trying to create, build and run a default application. I never had this problem using Xamarin on the Mac and I don't see why this is such a problem using Visual Studio 2015. Is there any knowledgebase article or something. I've install all the SDK form 24 down to 19 and still getting these errors. Some help is warranted.

    Thanks.

  • SpawnSPSpawnSP USMember

    @Strangerweather said:
    Hi there! Try this:

    Uninstall Build-Tools 24. Then go to android-sdk>Platforms and delete android-24.

    Hope it works!

    This one worked for me. Thanks!!

  • derrickagyemangderrickagyemang ✭✭ USMember ✭✭

    Didnt work for me

  • StrangerweatherStrangerweather ✭✭ GBMember ✭✭

    @SpawnSP said:

    @Strangerweather said:
    Hi there! Try this:

    Uninstall Build-Tools 24. Then go to android-sdk>Platforms and delete android-24.

    Hope it works!

    This one worked for me. Thanks!!

    You're welcome! Accept the answer? :wink:

  • QuarterHorsesQuarterHorses USMember

    This error message is caused by a mismatch between the SDK version and the build tool version. I didn't need to uninstall the SDK to solve this. You just need to reinstall the build tool and it should sync the version again and make everything happy. That is what worked for me.

  • SpawnSPSpawnSP USMember

    @QuarterHorses said:
    This error message is caused by a mismatch between the SDK version and the build tool version. I didn't need to uninstall the SDK to solve this. You just need to reinstall the build tool and it should sync the version again and make everything happy. That is what worked for me.

    For me, reinstalling build tools 24 makes the error appear again.

    @Strangerweather said:
    You're welcome! Accept the answer? :wink:

    I don't see an option on the forums for doing that, sorry. Maybe I'm too new!

  • RafalSobonRafalSobon USMember
    edited June 2016

    @Strangerweather said:
    Hi there! Try this:

    Uninstall Build-Tools 24. Then go to android-sdk>Platforms and delete android-24.

    Hope it works!

    Also in some cases right-clicking on Solution in Visual Studio and "Clean Solution" helps. It seems that Xamarin sometimes caches path to the build tools. After uninstalling Build Tools 24 and SDK Platform 24, Xamarin may still try to point to the "Android\sdk\platforms\android-24" non existing directory.

    Any idea why is this error appearing? Xamarin seems to be incompatibile with SDK API 24 (which is Android N) and Build Tools 24 but also there is no way of forcing Xamarin to use older version - it always keep using newest installed in SDK Manager. Even when in project settings in Visual Studio I set everything to use API 23 it keeps building against 24 (only solution is to uninstall)

    "Compile using Android version: Android 6.0 (Marshmallow)"
    "Minimum Android to target: Android 4.1 (API Level 16 - Jelly Bean)"
    "Target Android version: Android 6.0 (API Level 23 - Marshmallow)"

    I found this article:
    https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/

  • MichaelLant.6769MichaelLant.6769 USMember

    Thank you everyone for sharing.

    Several hours of frustrating research, countless failed builds and fix attempts for a default Android app finally led me here.

    Uninstalling "Build Tools" and "Platform Tools" for "Rev. 24" fixed the problems.

  • FalkFalk ✭✭ USMember ✭✭

    I did this:

    • Delete BuildTools 24 in SDK Manager
    • Update XamarinForms (2.0.xxxx) in NugetManager
      -- If one do that, he down graded the other Xamarin Android Installations to 23.03
    • DONT UPDATE THE OTHER NUGET XAMARIN ANDROID FRAMEWORKS TO 23.04 (See attachment)

    For me it works no errors in droid project

Sign In or Register to comment.