The file "obj\Debug\android\bin\packaged_resources" does not exist.



  • cwphillicwphilli USMember ✭✭✭
    edited May 5

    @cwphilli said:
    I ran into this problem.
    Using a hex value for a layout text color and forgetting the # in the string produced the error.

    @Manikandan_S said:
    This is due to many reasons. - (Not sure why xamarin still showing this error in case of XML error!!!!)
    Please check the XML file completely.
    In My case, it was mistakenly set for

    I ran into this again last night, android:margin instead of android:layout_margin was the culprit.

  • MuhammadAliYousafMuhammadAliYousaf USMember
    edited May 8

    I spent a lot of time to identify that issue. Finally I become able to resolve it by running the following options

    Project -> Run Code Analysis On On Solution

    After that, I found that an extra resource has been automatically added in the Resource.Designer.cs file, I simply remove that line and everything works like a magic. :)

    Xamarin should improve IDE to identify that issue during compile time, instead of giving that error while deploying the build on the device/emulator.

  • Tarek.AhmedTarek.Ahmed USMember

    Check the output window and you will view the xml file that's generating the error.

  • VijayPawar.0297VijayPawar.0297 USMember ✭✭

    I again ran into this problem but finally I realized from these discussion that there is small typo bug. Mine error was


    only I changed "b" to "B" what a bug.


    no its running good.

  • gBreckgBreck NIMember

    @Tarek.Ahmed said:
    Check the output window and you will view the xml file that's generating the error.

    This work for me.

    "Check the output"

  • BoguslawBlonskiBoguslawBlonski PLMember ✭✭✭

    @wojt said:
    Create folder 'packaged_resources' in [project folder or startup project]\obj\Debug\android\bin\ packaged_resources :) Works for me.

  • mubimubi USMember ✭✭✭

    Due to a jPG file i was facing this issue.

  • SabdullahSabdullah USMember ✭✭

    The error shows for me when my styles.xaml colors.xml or some other XML files had issues. It couldn't fully generate the build and thus was failing. Looking at the the Output window for errors may help.


  • BoguslawBlonskiBoguslawBlonski PLMember ✭✭✭

    I think it happens when dragging file to Vs from explorer , including hiden files seems to work.

  • AmeySawantAmeySawant USMember ✭✭

    Hi, Check to see if there are any unused entries in resources.designer.cs if there are any manually remove those entries.
    This will fix the issue.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai


    You never want to modify this file directly. It is generated by tooling and manual modification can mess up your project.

  • ChoMinChoMin USMember

    I have tried above.
    But it is not working well.

  • 15mgm1515mgm15 USMember ✭✭✭

    In my case was an asset name with "-", hope this helps to someone.

  • oliveiravitor3oliveiravitor3 BRMember ✭✭

    check if you have some file with "-" like "icon-test.png"

  • oliveiravitor3oliveiravitor3 BRMember ✭✭

    @MichaelShelestov thanks for your help.

    I renamed the file "icone-test.png" to "icone_test.png"

  • manuelgalindogmanuelgalindog MXMember ✭✭

    If someone still getting this error, i did everything you guys said in the post and nothing works.
    Clean and rebuild always work but compile to device (or simulator) just doesn't work.

    I solved this error running the same project on VS2015 (I usually work in XS), and the error list show an error diferente that Xamarin Studio, "Error processing PNG file". I just remembered that the newest image that i added to the project was firstly a JPEG, and i converted to PNG with the mac previewer tool and added to the project (Droid>Resources>Drawable for Android and iOS>Resources for iOS) i hadn't errors on iOS but Android was so annoying. I just deleted this file and compile to device like a charm, then i just convert the jpeg image to PNG with photoshop and everything works.

    Hope this helps.

  • AmodAmatyaAmodAmatya USMember

    I had an image in drawable named "Time Record".
    I renamed it as "TimeRecord" removing the space and the problem was solved.

  • AndreiLImaAndreiLIma USMember ✭✭

    In my case, I was have a resource with an "-" in its name. removing this symbol solves the issue for me.

  • DanielEstebanTabordaDanielEstebanTaborda COMember ✭✭

    @AmodAmatya said:
    I had an image in drawable named "Time Record".
    I renamed it as "TimeRecord" removing the space and the problem was solved.

    That worked for me , thanks.

  • RochaPiresRochaPires PTMember ✭✭

    What worked for me was removing android:name="Some Name" from manifest.

    <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="" package="SomeName.SomeName" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" /> <application android:name="Some Name" android:label="SomeName" android:icon="@drawable/Icon" android:theme="@style/Theme.AppCompat"> </application> </manifest>

  • OisFoleyOisFoley IEMember

    I had this error, and the solution was that I had added a "drawable-xhdpi" folder, and within it I had a PNG file named "delete-xhdpi.png". Removing the suffix fixed the problem(renamed to just "delete.png")

  • RaviAnandRaviAnand INMember

    I had the same problem. After removing the dash "-" sign from the image file name, the problem is solved. Bad error message! It should not be:

    The file "obj\Debug\android\bin\packaged_resources" does not exist.

    Writing an error message like this causing the Developer to think about something else while the problem is the illegal file name.

  • mostafa90mostafa90 USMember ✭✭
    edited August 6

    Faced same scenario and realized the following: i realized i was adding a call for some name spaces in the XAML for a removed library.

  • MuhammadhamzaMuhammadhamza USMember ✭✭

    i found this error when i add images in the resource folder of Resources/ Drawable / img.jpg img.png etc...
    just remove it.....
    hope so it will work

  • sameerpurohitsameerpurohit USMember ✭✭

    Unable to find the preview tools in sdk manager in my Android SDK manager.
    I am using visual studio 2015.
    Please help @TrucNgyen @lukasrein97

  • WesleyCurrieWesleyCurrie USMember

    I've run into the same problem on VS 2015 and VS 2017. My issue was the image file itself. Copied the same image over from a different source and the Android project compiled.

  • farhatwerfellifarhatwerfelli USMember


    The problem is that the name of the imported photo contains special characters. It's like in android studio, it does not accept name with spacial characters.

  • XigmondXigmond USMember ✭✭

    Hi guys, Im sure many people have the same problem or will get such an error msg sooner or later.
    Im just happy to tell you the solutions is so simple !!

    you will NOT have to delete/reinstall or do anything of that kind !

    check all your resources :

    1. starting with your images and other files you added to your resource folder, the resource name can only contain characters a to z, 0 to 9 , you cant have a "-" or "{" , ... in your resource file name.
    2. check the activity name ... ( i think a friend explained it before )

    and finally check the .net and Xamarin documentation about resources names rules ...

    one very useful step to find out whats going wrong is to get more details from the build process, in order to do so :smile:
    - In Visual Studio: Tools> Options> Projects and solutions> Build and Run.
    - In the Dropdown : MSBuild project build output verbosity:> Diagnostic.

    I spent near 6 hours on this problem, I hope sharing this help you pass this kind of problems .

    love you all , and Love Xamarin <3

  • BaqerNaqviBaqerNaqvi USMember ✭✭

    You resouce file name can only consist of 1-9, a-b or A-b. No invalid characters.

  • kumarkumarkumarkumar USMember

    "err:The file "obj\Debug\android\bin\packaged_resources" does not exist"

    This issue is caused by one of the images in drawable folder of your android project, you can resolve this by deleting faulty image in drawable folder.

  • AlexSAlexS USUniversity ✭✭

    Still having this problem on latest stable Xamarin.Android and no build tools v24 installed.

    Diagnostic build level shows no information about which resource name or layout rule is bad. Will keep posted what was the problem when I solve it

  • AlexSAlexS USUniversity ✭✭

    With great help from @JonDouglas I was able to locate the problem.

    To do that, we had to open diagnostic build log and find lines like:

      Executing package -f -m -M ..
    Done executing task "Aapt".

    Then copy everything starting from the word "package" till the end of the line (it should be long).
    Then locate aapt (mine was here: /Users/username/Library/Developer/Xamarin/android-sdk-macosx/build-tools/26.0.2/aapt and run it with the arguments we just copied and with one additional argument in the end - -v

    /Users/username/Library/Developer/Xamarin/android-sdk-macosx/build-tools/26.0.2/aapt package -f -m -M .... .... .... ... -v

    It revealed exact error and the file it's choking.
    For example, my output was:

    obj/Debug/res/values/styles.xml:1: note: using v21 attributes; synthesizing resource com.pack.package:style/Theme.App.ActionBar for configuration v21.
    obj/Debug/res/values/styles.xml:1: note: using v16 attributes; synthesizing resource com.pack.package:style/Theme.App.Button for configuration v16.
    obj/Debug/res/values/styles.xml:1: note: using v16 attributes; synthesizing resource com.pack.package:style/Theme.App.ChoosePorch for configuration v16.
    obj/Debug/res/values/styles.xml:1: note: using v16 attributes; synthesizing resource com.pack.package:style/Theme.App.CarTypeDialog for configuration v16.
    obj/Debug/res/values/styles.xml:1: note: using v16 attributes; synthesizing resource com.pack.package:style/MenuLabelsStyle for configuration v16.
    [1]    40940 segmentation fault   package -f -m -M  -J  --custom-package com.pack.package -F  -S  -S  -S

    Googling segmentation fault + aapt, turned out there was @+id in styles (should not be there at all) that was the reason for the error.

    Yay. Mystery solved, experience gained and knowledge shared.

    Would be great to have an option for Xamarin.Android to add -v to get detailed output from all Android tools.

    Thank you, Jon!

  • EraldoJuniorEraldoJunior USMember

    After almost loose my mind, I've changed "MSBuild project build output verbosity" to Detailed in Tools>Option>Project and Solutions>Build and Run, and found the solution:
    In my case the names of some image files in drawable contains '-', what is not allowed.
    Hope that helps.

  • Ph0b0xPh0b0x PRMember

    @wojt said:
    Create folder 'packaged_resources' in [project folder or startup project]\obj\Debug\android\bin\ packaged_resources :) Works for me.

    This worked for my at a build stage... but then i get an error that says "permissions denied" for that folder.... any ideas?

    I do not have any "-" dashes on any resource file...

Sign In or Register to comment.