I resolved it by removing portable library that contains the business logic from the android and then rebuild it separately. After rebuilding, clean your android project and add reference again to your portable class library. Finally build the android project.
One more suggestion for developers, who did not find solution above (I too).
When I got 'The file "obj\Debug\android\bin\packaged_resources" does not exist' I tried to rollback source code to old one (so old as it was possible) and found, that there is no error mentioned. So the problem probably was not with Android SDK. I started to check newer versions of code (binary search ) and finally found two closest revisions of source codes, where older copy does not have error, but newer one does. The problem was in NAME OF ADDED IMAGE in '...Droid\Resources\drawable\' - it contained '-' (minus) in name, 'btn-refresh.png'. I have renamed it to 'btn_refresh.png' - and all ok. Many hours spent !#^"%;!"№; !
@JodiBennett - I found same solution too, finally. I found two closest revisions of source codes, where older copy does not have error, but newer one does. The problem was in name of added image, containing '-'. I have changed it to '_' - and all ok. Hours has been spent !#^"%;!"№; !
Srikanthbollojula probably your file has "-" or another special character not allowed.
Thank you @MichaelShelestov , I installed a file wich the O.S. renamed and I did not see it, now is resolved.
Is dificult to discover it because the error not occours when you add the wrong file, just when you clean the project and try to build. I rarely clean the project, I did it only because my icons was not updating, just because the new wrong file...
Had the same errors after editing the AndroidManifest.xml adding <activity android:windowSoftInputMode="stateHidden"></activity>
Removing this line gets rid of the errors
Errors: The file "obj\Debug\android\bin\packaged_resources" does not exist "aapt.exe" exited with code 1
@vsg24 said:
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.
Got the same problem, got a '-' in one of my image files in the Resource folder, removed it and it was fixed.
The problem here may be various things. So you should always try first with setting output verbosity to diagnostic (Tools -> Options -> Projects and solutions -> Build and run) and inspecting the output. It will tell you if you're having resource with '-' or missing some resource or anything else.
I was able to resolved by issue by renaming the file.
The issue was as you pointed out:
"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.
Had the same problem. My error was in the manifest: I had Version Code (Version number) set at "1.0.0" and it wasn't allowed. It only takes integers so I had to revert to "1".
@MichaelShelestov said:
One more suggestion for developers, who did not find solution above (I too).
When I got 'The file "obj\Debug\android\bin\packaged_resources" does not exist' I tried to rollback source code to old one (so old as it was possible) and found, that there is no error mentioned. So the problem probably was not with Android SDK. I started to check newer versions of code (binary search ) and finally found two closest revisions of source codes, where older copy does not have error, but newer one does. The problem was in NAME OF ADDED IMAGE in '...Droid\Resources\drawable\' - it contained '-' (minus) in name, 'btn-refresh.png'. I have renamed it to 'btn_refresh.png' - and all ok. Many hours spent !#^"%;!"№; !
@IvanR said:
The problem here may be various things. So you should always try first with setting output verbosity to diagnostic (Tools -> Options -> Projects and solutions -> Build and run) and inspecting the output. It will tell you if you're having resource with '-' or missing some resource or anything else.
very good point thx very much! in my case it was because of:
1> obj\Debug\android\manifest\AndroidManifest.xml(14): error APT0000: No resource found that matches the given name (at 'label' with value '@string/app_name'). (TaskId:234)
1> obj\Debug\android\manifest\AndroidManifest.xml(14): error APT0000: No resource found that matches the given name (at 'theme' with value '@style/MyTheme'). (TaskId:234)
in AndroidManifest.xml make sure that no names depending on other resources which no longer exist for Ex:
android:label="@string/app_name" so we have to go to our resources/string.xml
My issue ended up being what I entered into either (not sure which one) android:versionCode="1.0" or android:versionName="1.0" within the Android project's AndroidManifest.xml file. Changing both values to just 1 and rebuilding fixed the issue.
I was able to solve this issue by using SDK Manager and making sure I have the correct versions. In my case, I chose all the latest. My SDK Tools and SDK Platform-Tools were using V25. However, my build tools were using V23. I've upgraded Build tools to 25 and it worked successfully.
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 android:layout_weight="wrap_content"
Answers
I have added JPG file to the drawable folder and caused this issue.. Removed it has resolved the issue..
It looks like this is fixed in "24.0.1"
Hello Guys,
I deleted the rev 24 but i still have the issue when i try to build in release mode...
@vsg24 Sweet! This solved my issue.
Tanks, resolve to me!!! i'm one week with this error. tks :DDD
I had the same issue. Mine was causing by underscore ("_") in some icon names. Renamed the icons and all good.
Dave
I resolved it by removing portable library that contains the business logic from the android and then rebuild it separately. After rebuilding, clean your android project and add reference again to your portable class library. Finally build the android project.
OK guys! thanks!@angelocarlotto,I solved my problem by your way!
One more suggestion for developers, who did not find solution above (I too).
) and finally found two closest revisions of source codes, where older copy does not have error, but newer one does. The problem was in NAME OF ADDED IMAGE in '...Droid\Resources\drawable\' - it contained '-' (minus) in name, 'btn-refresh.png'. I have renamed it to 'btn_refresh.png' - and all ok. Many hours spent !#^"%;!"№; !
When I got 'The file "obj\Debug\android\bin\packaged_resources" does not exist' I tried to rollback source code to old one (so old as it was possible) and found, that there is no error mentioned. So the problem probably was not with Android SDK. I started to check newer versions of code (binary search
@JodiBennett - I found same solution too, finally. I found two closest revisions of source codes, where older copy does not have error, but newer one does. The problem was in name of added image, containing '-'. I have changed it to '_' - and all ok. Hours has been spent !#^"%;!"№; !
I got that error after importing a config.target file with following settings, switching generated files to be created on a RAM disc:
E:\$(SolutionName)\$(ProjectName)\bin\$(Configuration)\
E:\$(SolutionName)\$(ProjectName)\obj\$(Configuration)\
$(BaseIntermediateOutputPath)\
After removing the import everything works fine as before.
For me it looks like hard coded directories in a build script.
Srikanthbollojula probably your file has "-" or another special character not allowed.
Thank you @MichaelShelestov , I installed a file wich the O.S. renamed and I did not see it, now is resolved.
Is dificult to discover it because the error not occours when you add the wrong file, just when you clean the project and try to build. I rarely clean the project, I did it only because my icons was not updating, just because the new wrong file...
I just removed the '-' (special character) from all the resources names. and It worked like charm
Thank you!!
Had the same errors after editing the AndroidManifest.xml adding
<activity android:windowSoftInputMode="stateHidden"></activity>
Removing this line gets rid of the errors
Errors:
The file "obj\Debug\android\bin\packaged_resources" does not exist
"aapt.exe" exited with code 1
VS2015 Update3
Xamarin 4.2.1.58
Xamarin Android 7.0.2.37
Please fix!
@ArthurMoreira Thank you so much, My problem was that my intent filters has spaces. Thanks bro
Got the same problem, got a '-' in one of my image files in the Resource folder, removed it and it was fixed.
The problem here may be various things. So you should always try first with setting output verbosity to diagnostic (Tools -> Options -> Projects and solutions -> Build and run) and inspecting the output. It will tell you if you're having resource with '-' or missing some resource or anything else.
Thanks Vahid Amiri Motlagh[vsg24]
I was able to resolved by issue by renaming the file.
The issue was as you pointed out:
"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.
I fixed this error by getting someone on my team to send me the file from his project.
it worked mate, thanks!!!
Actually, if I clean the problem comes back. So it didn't really fixed my problem.
I still have the problem, tried several solutions proposed in the article but none solved for me.
Can anybody help me?
Thanks.
Friday and Monday lost
I was able to solve this problem in specific.
It was a problem in AXML.
In my case it was an 'android: layout_alignLeft = "true"' within a LinearLayout.
Leave verbosity enabled, including no Xamarin Diagnostics (Tools> Options> Xamarin> Android Settings).
In Output find Error description:

thanks matie, you helped solve mine
I had this on a .xml file
"item name="indeterminateTintMode" src_atop item"
"item name="indeterminateTint" @color/white item"
I did like you suggested to find the bug
removed that and it worked!!! thanks!
Had the same problem. My error was in the manifest: I had Version Code (Version number) set at "1.0.0" and it wasn't allowed. It only takes integers so I had to revert to "1".
I mixed up Version Code and Version Name.
i solved this . just select proper android compiled vesion
oper android compiled vesion
@angelocarlotto thanx brother. Worked for me. Didn't need any re-install. Thanks a lot
..
Thanks a lot! You are my hero today !
very good point thx very much! in my case it was because of:
1> obj\Debug\android\manifest\AndroidManifest.xml(14): error APT0000: No resource found that matches the given name (at 'label' with value '@string/app_name'). (TaskId:234)
1> obj\Debug\android\manifest\AndroidManifest.xml(14): error APT0000: No resource found that matches the given name (at 'theme' with value '@style/MyTheme'). (TaskId:234)
I ran into this problem.
Using a hex value for a layout text color and forgetting the # in the string produced the error.
in AndroidManifest.xml make sure that no names depending on other resources which no longer exist for Ex:
android:label="@string/app_name" so we have to go to our resources/string.xml
1833294650235727
This for me was caused by inadvertently adding the line :
android:layout_height="0"
instead of
android:layout_height="0dp"
I have filed an issue on this a couple weeks ago. Please look into the description for details:
https://bugzilla.xamarin.com/show_bug.cgi?id=55232
It seems like this is potentially fixed in a current Alpha version.
My reason is the Version Code, it must be a number like "1", but I set it "1.0".
It's worked for me.
Thank you.
My issue ended up being what I entered into either (not sure which one)
android:versionCode="1.0"
orandroid:versionName="1.0"
within the Android project's AndroidManifest.xml file. Changing both values to just1
and rebuilding fixed the issue.I was able to solve this issue by using SDK Manager and making sure I have the correct versions. In my case, I chose all the latest. My SDK Tools and SDK Platform-Tools were using V25. However, my build tools were using V23. I've upgraded Build tools to 25 and it worked successfully.
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
android:layout_weight="wrap_content"