error aapt.exe exited with code 1

lulu ITMember ✭✭

Hi I'm new in this forum, I created an application when I get a error "aapt.exe exited with code 1" but I don't understand what it means, I use the IDE VS2012, help me please.

«1

Posts

  • lulu ITMember ✭✭
    edited December 2012

    ok, now when I click on error I appeared this:

    <!-- Run aapt to generate R.java -->
    <Aapt
        AndroidSdkDirectory="$(_AndroidSdkDirectory)"
        JavaPlatformJarPath="$(JavaPlatformJarPath)"
        ManifestFile="$(ResgenTemporaryDirectory)\AndroidManifest.xml"
        PackageName="$(_AndroidPackage)"
        ResourceDirectory="$(MonoAndroidResDirIntermediate)"
        JavaDesignerOutputDirectory="$(ResgenTemporaryDirectory)"
        ResourceOutputFile="$(ResgenTemporaryDirectory)\resources.apk"
        ExtraPackages="$(AaptExtraPackages)"
        AdditionalResourceDirectories="$(LibraryResourceDirectories)"
        LibraryProjectJarsWildcard="$(IntermediateOutputPath)__library_projects__\*.jar"
        ExtraArgs="$(AndroidResgenExtraArgs)"
    />
    

    what does it means?

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    It means that the <Aapt/> MSBuild task is failing (throwing an exception), and that's what MSBuild/Visual Studio are reporting. That doesn't tell you why it's failing; for that we need verbose/diagnostic MSBuild output.

  • lulu ITMember ✭✭

    but I don't understand where is the error

  • Matt_SeqMatt_Seq USMember

    Hi I'm getting aapt.exe exited with code 1 and I've done what you advise above and can't see where it's failing at all. Perhaps you guys could tell me where it's failing because I'm at my wits end.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    @MatthewHut - Just a stab in the dark here, but I see that you have some spaces in your resource directories, plus a - (dash). It might be that this is making aapt unhappy. Can you rename or relocate these directories so there are no spaces or dashes in the path?

    Here is a sample command line parameter being passed to aapt:
    -S "D:\TFSOnline\Lions - Apps 2013\branches\dev\src\Droid\obj\Debug__library_projects__\ActionBarSherlock\library_project_imports\res"

  • Matt_SeqMatt_Seq USMember

    Thanks for the advice. This morning I've set everything up on my mac (was on win8) and fired up Xamarin Studio... at last sensible errors! Turns out it's a @color/blah in my style that was written @color/blah" notice the "

    Could have saved myself if I'd used my mac days ago!! Thanks for the reply though topgenorth

  • RajeshSirRajeshSir USMember

    Hi

    I am also getting this type error and i have also follow to below instruction but i am not success
    why ? i am still on my error. please any one resolve my problem....

    @lu: Within Visual Studio:

    Click TOOLS > Options...
    In the left-hand tree view, select Projects and Solutions > Build and Run
    In the right-hand panel, set the MSBuild build output verbosity dropdown to Diagnostic
    Click OK
    Click View > Output (Ctrl+W, O).
    Clean and rebuild your package.
    The Output panel contains the diagnostic build output. Search the output for "aapt", and please provide the surrounding text.

    Thanks in advance

  • thientructhientruc USMember

    this is my surrounding text: C:\Program Files (x86)\Android\android-sdk\build-tools\21.0.1\aapt.exe package -f -m -M "C:\Users\Trúc\AppData\Local\Temp\5uyw2zbf.w3h\AndroidManifest.xml" -J "C:\Users\Trúc\AppData\Local\Temp\5uyw2zbf.w3h" --custom-package prmiipay.prmiipay -F "C:\Users\Trúc\AppData\Local\Temp\5uyw2zbf.w3h\resources.apk.bk" -S obj\Debug\res -I "C:\Program Files (x86)\Android\android-sdk\platforms\android-19\android.jar" --no-crunch --auto-add-overlay (TaskId:70)
    1>Done executing task "Aapt". (TaskId:70)

  • atulagarwalatulagarwal USMember

    can you tell why i am getting this issue
    1.Error: mtouch exited with code1

  • AlfeuMagalhaesAlfeuMagalhaes BRMember
    edited November 2014

    I just delete : "" from my AndroidManifest.xml. Work for me

    *

  • ncalvetncalvet ESMember, Beta

    I get an aapt error as well. It was building an old project I hadn't built for some time. I can't think about what has changed in the project except some code. The diagnostics output is this:

    2>Using "Aapt" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
    2>Task "Aapt" (TaskId:248)
    2> Task Parameter:JavaPlatformJarPath=F:\Program Files (x86)\Android\android-sdk\platforms\android-17\android.jar (TaskId:248)
    2> Task Parameter:ManifestFile=C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao\AndroidManifest.xml (TaskId:248)
    2> Task Parameter:PackageName=com.steema.teechart.xamarin.android (TaskId:248)
    2> Task Parameter:ResourceDirectory=obj\Debug\res\ (TaskId:248)
    2> Task Parameter:JavaDesignerOutputDirectory=C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao (TaskId:248)
    2> Task Parameter:ResourceOutputFile=C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao\resources.apk (TaskId:248)
    2> Task Parameter:ToolPath=F:\Program Files (x86)\Android\android-sdk\build-tools\21.0.1\ (TaskId:248)
    2> Task Parameter:ApiLevel=17 (TaskId:248)
    2> Task Parameter:AndroidUseLatestPlatformSdk=False (TaskId:248)
    2> Aapt Task (TaskId:248)
    2> AssetDirectory: (TaskId:248)
    2> ManifestFile: C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao\AndroidManifest.xml (TaskId:248)
    2> ResourceDirectory: obj\Debug\res\ (TaskId:248)
    2> JavaDesignerOutputDirectory: C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao (TaskId:248)
    2> PackageName: com.steema.teechart.xamarin.android (TaskId:248)
    2> UncompressedFileExtensions: (TaskId:248)
    2> ExtraPackages: (TaskId:248)
    2> AdditionalResourceDirectories: (TaskId:248)
    2> AdditionalAndroidResourcePaths: (TaskId:248)
    2> LibraryProjectJars: (TaskId:248)
    2> ExtraArgs: (TaskId:248)
    2> CreatePackagePerAbi: False (TaskId:248)
    2> F:\Program Files (x86)\Android\android-sdk\build-tools\21.0.1\aapt.exe package -f -m -M C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao\AndroidManifest.xml -J C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao --custom-package com.steema.teechart.xamarin.android -F C:\Users\ncalvet\AppData\Local\Temp\u3n2u0z2.5ao\resources.apk.bk -S obj\Debug\res -I "F:\Program Files (x86)\Android\android-sdk\platforms\android-17\android.jar" --auto-add-overlay --max-res-version 17 (TaskId:248)
    2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(794,2): error MSB6006: "aapt.exe" exited with code -1073741819.
    2>Done executing task "Aapt" -- FAILED. (TaskId:248)

    Thank you very much for any help that you are able to provide.

  • If any of the image is having any symbols or " " you get this error

  • amir.6930amir.6930 USMember

    Thanks...
    I have "-" character in file project , delete this Char and bingo, solved my problem.

  • heemanshubhallaheemanshubhalla INMember ✭✭

    i have suffered from this error then i found a solution to this problem that i have posted on my blog with some explanation or reason for this error

    http://geeksprogrammings.blogspot.com/2014/10/adt-bundle-windows-x8664.html

  • I have Empty space in my file name ,After removed issue gone! :smile:
    Example : Dynamic Home.axml -->DynamicHome.axml.

  • AbdulbashaAbdulbasha USMember ✭✭

    Thanks All, I have this aapt exe exited with code-1 problem, Luckly i solved this problem with this forums solutions. In my project image contains this" ". when removed this my problem is solved.

  • AvisAvis USMember

    This is very irritating problem. finally i got it .Don't include any special characters in your projects like - .
    Keep the images names too clean without any this -

  • Chris.3704Chris.3704 USUniversity ✭✭

    I had the same issue with images in the Android Resources that contain a dash. I just wished the error message was more clear. Going from
    "aapt.exe" exited with code 1.

    to renaming images with a dash is a large step for me...

  • Got the same problem with @ in a file name. Perhaps this will help someone else, took me a while to figure it out.

  • JSMDEVJSMDEV ESUniversity

    As CodeMonkey pointed out the problem was with a resource with "-" in the name (specifically: and imageBlaBla-512.png)

    I removed that character form the name and it started to work again. Cheers!

  • i followed the tips:-
    "Click TOOLS > Options...
    In the left-hand tree view, select Projects and Solutions > Build and Run
    In the right-hand panel, set the MSBuild build output verbosity dropdown to Diagnostic
    Click OK
    Click View > Output (Ctrl+W, O).
    Clean and rebuild your package.
    The Output panel contains the diagnostic build output. Search the output for "aapt", and please provide the surrounding text."

    and i got this when i build my solution again=

    1>------ Build started: Project: LoginNew, Configuration: Debug Any CPU ------
    1> Processing: obj\Debug\res\layout\main.xml
    1> Processing: obj\Debug\res\values\strings.xml
    1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1016,2): error MSB6006: "aapt.exe" exited with code 1.
    1>F:\projects\LoginNew\LoginNew\ORM\SQLite.cs(241,15,241,39): warning CS0649: Field 'SQLiteConnection._preserveDuringLinkMagic' is never assigned to, and will always have its default value false
    1>F:\projects\LoginNew\LoginNew\MainActivity.cs(14,13,14,18): warning CS0414: The field 'MainActivity.count' is assigned but its value is never used
    1> LoginNew -> F:\projects\LoginNew\LoginNew\bin\Debug\LoginNew.dll
    1> Processing: obj\Debug\res\layout\main.xml
    1> Processing: obj\Debug\res\values\strings.xml
    1> Processing: obj\Debug\res\layout\main.xml
    1> Processing: obj\Debug\res\values\strings.xml
    1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1480,3): error MSB6006: "aapt.exe" exited with code 1.
    1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1505,3): error MSB3375: The file "obj\Debug\android\bin\packaged_resources" does not exist.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any help???. plz be specific and clear becoz i am new to xamarin...Step by step help will be more helpful

  • YkshLeoYkshLeo USMember ✭✭✭✭
  • I solved the problem by deleting a file containing "-" in the resources directory

  • KaylerKayler ZAMember

    Thanks @CodeMonkey you saved me hours of frastations

  • nagarjunaKnagarjunaK USMember

    I got this error when i mistakenly renamed the (android ) res folder in name from "resources" to "Resources". When i flipped it back, build is working well.

  • RiaanGreylingRiaanGreyling USMember ✭✭

    @CodeMonkey. Thanks mate. Removing "-" from the file name works. Android dev is such a fucking hack.

  • Yousif_GarabetYousif_Garabet USMember
    edited June 2016

    I just deleted '-' from .axml page and it Works for me :smile:

  • jaypedrojaypedro USMember

    @CodeMonkey said:
    I get this error if I include images in my drawable folder which contain '-' characters in the name. Make sure your images don't contain this character.

    This fixed it for me thanks.

  • ApoorvApoorv INMember
    edited June 2016

    i am facing this same error, even i am starting a new project and wen i build project then it shows same error "aapt.exe exited" and one more "obj\Debug\android\bin\packaged_resources" does not exist.", i did uninstall visual studio 15 and xamarin but after reinstall its showing these same errors again, plz help!

  • diepainpaindiepainpain USMember

    @JonathanPryor thanks u saved my day spent hrs figuring mistakes i did during late nitz programming causing this error

  • aquabayaquabay AUMember ✭✭

    Adrian Estran's answer fixed my problem. Thanks. I keep forgetting that odd behavior and it always causes problems that are difficult to diagnose.

  • LineikosenLineikosen INMember

    In Mono.Android projects this error occurred when a Resources/Layout axml file has white spaces in the name, eg. "Copy of xxxx.xaml"

  • Arnav_RohitArnav_Rohit USMember ✭✭
    edited January 2017

    @CodeMonkey said:
    I get this error if I include images in my drawable folder which contain '-' characters in the name. Make sure your images don't contain this character.

    thanx this solve me error

  • sharathgsharathg USMember

    @CodeMonkey said:
    I get this error if I include images in my drawable folder which contain '-' characters in the name. Make sure your images don't contain this character.
    It solved my issue as well

  • I have resource name with '-' character. I removed the same, and issue gone :)

«1
Sign In or Register to comment.