When attempting to compile my Xamarin.Android app I get the compile error:
Error 3 The file "obj\Debug\android\bin\packaged_resources" does not exist. MyApp.UI.Droid
This error occurred after I made some changes (added some new classes - cannot remember what it was). But I didn't change any project settings, nor go delete actual files in the obj folder.
What is the cause of this error and how can I fix this?
Some information that may be useful:
The project is a Cross-Platform PCL project - Core, Android, and iOS Projects
The project uses MVVM Cross
I encountered the same issue. Ensure that your resource files do not include any special characters
The actual error you may be encountering is:
Invalid file name: must contain only [a-z0-9_.]
Change your build output verbosity in visual studio to see better log output.
I´ve had the same issue.
Then i´ve reviewed my resource file names.
Solution:
One file was using "-" in it´s name. (invalid character)
Then i replaced for "_" (underline).
PS:
=> file name: must contain only [a-z0-9_.]
You will need to grub down by switching on Verbose output. What is stopping the generation of packaged_resources?
In VS2013 choose Tools --> Options --> Build and execute, choose verbosity Diagnostic.
In VS2015, the same option is in Tools --> Options --> Projects and Solutions --> Build and Run.
In my case, it was a hyphen character in the name of the action property of an Intent filter, but choosing verbose output will point you to the line that has the problem.
Follow the steps below to identify the problem:
1 - In Visual Studio: Tools> Options> Projects and solutions> Build and Run.
1.1 - In the dropdown: MSBuild project build output verbosity:> Diagnostic.
1.2 - Close the dialog box.
2 - View> Output (Ctrl + W, O).
3 - Run the build or rebuild.
In the output find the line:
C:\Program Files
(x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1665,3):
error MSB6006: "aapt.exe" exited with code 1.
What is just above this error is what caused the error.
i also found that removing the packages in Tools/Preview Channel and Android N AND ALSO Android SDK Build Tools rev 24, done a build and worked.. This is a complete new portable project/android/ios
Another possibility is you have an issue with the installed Android SDK build tools. For me, when I removed the package for Revision 24 it worked.
From Xamarin Forums:
First of all go and deinstall preview tools in your android sdk
manager. If you havent installed it but still get the same error then
go and deinstall Android SDK Build Tools Rev. 24.
The Problem we have here is that, if you have Appcombat, RecyclerView
or something like that in your project, the library rev of these
librarys are below rev 24. They are still on 23.2.1 but not on rev 24.
So if you installed Build-Tools Rev 24 and want to build your project
the build cant find the rev24 resource package of your librarys.
You can check it on your own Go in the SDK Manager and check "Obsolete" Then go to the folder Extras and there you can see
"Android Support Library (Obsolete) Rev 23.2.1. And then check if
there is Android Support Library Rev 24 in your Extras Folder. No? And
thats the Problem here. We got the Update for Build Tools to early and
have to wait for Library Update. Then we all can use Build Tools 24!
So only update to BuildTools Rev 24 when we got an update for support librarys and have the rev24 librarys.
Basically the problem is with special character of Resource FILE NAME.
In my case, I am keep getting error "The file "obj\Debug\android\bin\packaged_resources" does not exist.":
..\Resources\drawable\company-app-log.png having -(hyphen) between alpha characters is the root-cause of the issue.
Using Xamarin Studio here -
Sometimes this is caused by AXML errors.
Which if you turn on detailed / diagnostic in preferences you can
search the build output (or your packaging output) for the word ERROR.
For example, somebody checked in some AXML line(s) with -
android:Text="something"
and the uppercase T was causing this error -
Resources/layout/Somefile.axml(11): error APT0000: No resource identifier found for attribute 'Text' in package 'android'
Fixing the errors fixed the original message.
Firstly, i suggest you change "show out put from" Build to Xamarin to see the real error and its details as seen in my case
At first
And then
please make sure you installed your NDK properly. That was the issue with mine,
and please make sure the NDK directory is also set
hope this helps someone
I just lost 7 hours of my day.. You know what I did?
Project.Droid -> Resources -> RightClick on the Resource.Designer.cs -> Delete
I did fu****n' works ! ><
EDIT
Omg it did comes back... Why does Windows has all time so much of bugs... seriously..
Same annoying problem with me!
But I found a solution: read carefully this article:
https://gxconsultancy.wordpress.com/2016/04/04/to-use-xamarin-or-not-to-us-xamarin/
In short:
Make sure you have JDK 32bits version 8 at least - same for the JRE, included in the JDK installation kit from Oracle;
Set your project for using the Xamarin debugger (right-click your project, hit Properties / Android Options / Packaging / Debugger);
And now the most weird: delete the app/Resources/drawable folder; have a working Xamarin project and copy its "drawable" folders to the erratic project (usually there are several subfolders, like drawable-hdpi, drawable-mdpi and so fort).
Rebuild your Android project.
I had the problem so I deleted build-tools 24.0.0 and I used build-tools 23.0.3 and the problem solved. Try it!
make sure that your resources don't have any special character or start with number
Encountered same issue in VS 2015 and Xamarin 7.2.0.7. In my case, the issue happened just suddenly, and turned out the issue caused by wrong element name in axml, traced using Tiago's answers above.
So I didn't find the line Tiago mentioned with aapt.exe, but I then I tried to search for keyword failed in output. Then I found one telling me about margin. In android, margin is set using android:layout_margin. I played with element and forgot and put android:margin instead, thus also why it happened so sudden after so many successful run. Fixed it and the build succeeded.
In my case the error was caused because I set the version number in the manifest to 1.0. Apparently the version number must be an integer.
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.
For me this error was caused by having an invalid attribute value in a layout xml. I had
android:id="button"
changing it to
android:id="#+id/button"
fixed the error.
Not sure if this is a late answer, but this specific error message occurs for one of the two reasons:
(Most probably the case): In your layout file, you may have mentioned a resource (drawable/image) incorrectly. For example, the image was in the mipmap folder path but you have pointed it wrongly to the drawable folder path.
Per many comments, there could be a hyphen or special character in one your resources' names or it starts with a number. However, please note, in this specific case, you will mostly see a aapt.exe has stopped or appt.exe has exited with error code 1 error. I am not sure if you will get obj\Debug\android\bin\packaged_resources not found error. My experience says that point 1 above is the case.
Got this error in Visual Studio 2017 Xamarin android project on Windows.
After lot of experiments with resource's files I found, that filename length and extension of image file in the drawable folder affect the result of compillation!
drawable/abcde.png - compilled ok
drawable/abcdef.png - error, "obj\Debug\android\bin\packaged_resources" does not exist
If rename image to file without .png extension, compilled without errors.
Spended a lot of time and was confused :-/
I had the same problem. To solve I had to remove all nuget packages from droid project, and reinstalled xamarin.forms again (has to be same version used in other projects).
had the same issue. This was because i had an .png file that had a "-" character in it's name. Just enusure any of your resources don't have the "-" hyphen character
Related
I'm fighting with that issue for 2 days already and can't find any solution.
I have an Xamarin Android app in Visual Studio 2017 consisting of three projects:
Xamarin.Android project (main one)
Android-specific unit tests run on the device - project of type NUnit 3 Test Project (Android) created using NUnit Templates for Visual Studio
Platform-independent unit tests project (project of type Unit Test Project (.NET Framework))
Everything worked just fine until now. When I selected my main project as the Startup one, my app was deployed to the device/emulator. When I selected my Android-specific unit tests project, the test project was deployed and unit tests executed by nUnit Xamarin Runners on the device/emulator.
However few days ago I updated my Visual Studio 2017 with the newest available update and now, when trying to build this android-specific unit tests project I get the following error:
The file "obj\Debug\android\bin\packaged_resources" does not exist.
I've searched everywhere, including this and this SO topics. I also totally reinstalled Visual Studio 2017 and Xamarin with Android SDK included. Nothing helped. From what I read I suspect there is something wrong with the versions of Android SDK Build-tools I have installed. Here's what I have currently installed in SDK Manager:
As the other SO threads suggested, I tried uninstalling the newest Android SDK Build-tools (25.0.2) and installed version 23.0.3 (all my projects target Android 6.0), but it also doesn't help, I still have the same error.
Maybe it's worth adding that this issue may have started to happen when I tried to implement RecyclerView in my app reading this tutorial, where they suggested to install Android 7.1.1 (API 25) in SDK Manager. However I undoed my all changes after that and even reintalled VS2017 + Xamarin.
Do you have any other idea why this can be ? I'd really appreciate any help. Thanks!
EDIT 2017-04-09:
Egh, I removed VS2017, installed VS2015 with brand new Android SDK and still the same issue :(
I've finally found what was the issue. It wasn't related to any component from SDK Manager or VS version.
Following localization tutorial from developer.xamarin.com, I played a bit with Strings.xml in my Android project. I wanted to have my Activities Label taken from resources as well, so in the ActivityAttribute I defined:
[Activity(Label = "#string/peopleListTitle")]
and added this value in Strings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-------Other resources values ----->
<string name="peopleListTitle">People List</string>
</resources>
In that case my build is failing with above-mentioned error:
The file "obj\Debug\android\bin\packaged_resources" does not exist
When I change ActivityAttribute to use a string directly:
[Activity(Label = "People List")]
the build is passing without any issues.
I managed to find a solution, but actually I don't know why it's not building when I try to use Label text defined in Strings.xml.
BTW, I managed to find what's the problem by setting build output verbosity to Diagnostic in Tools -> Options -> Projects and Solutions -> Build and Run which gives a detailed info why the build failed in the Output window.
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.
I had the same issue when I added a new image as a resource.
There was a '-' in the file name (Invalid resource name character). I renamed & removed that character and all good.
Resource name can only consist of 0-9,a-z or A-Z or combination of any.
I had the same problem, and i removed all image file name have "-" character. My problem solved
Another reason for this error is that you may have a float number as your version number. In my case I changed it to a integer and everything worked fine. (I found the error by switching the build output to Detailed)
Simply it worked.
In one case I copied and pasted previous working "packaged_resources"
in the bin folder.[the problem was it did not reflect the UI changes]
Other I opened the visual studio as
administrator.
Next changed the "Minimum target to Android" to lower
apis in the project properties windows.
I suggest not touching the code behind of the design. If you get this error simply pull some button from the tool bar into the design and visual studio will come to its consciousness that there is change in UI. Next click on save all so that it make necessary change in the designer file.
Mine was a different solution (and only half a day lost): I was having trouble getting Hockey app to match crashes against the correct version of the app and realised it uses VersionCode not VersionName so I change my code to "0.0.34" the same as the name. For some still unknown reason the app built and deployed to devices for about 3 days before I started getting this error The file "obj\Debug\android\bin\packaged_resources" does not exist. Setting it back to a numeric value fixed the problem.
I found the problem by looking back through my GIT logs and rebuild each push until I found the one that caused the problem.
It just because the Version Code,I set Code by '1.0',The file "obj\Debug\android\bin\packaged_resources" does not exist.;And I set it by '1',everything is ok.
Had the same error, the way I got over it was crank up the Android SDK manager and install all updates and remove any obsolete packages. This happened to me because I was targeting something newer which was not installed.
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.
After following several online suggestions - updating SDK, updating Xamarin etc - none of which worked for me.
Finally found that I had an activity for a Android provider to Alarm clock in my AndroidManifest file as below
<activity
android:name="com.njcommuter.droid/android.provider.AlarmClock"
android:label="AlarmClock"
.....
/>
Removing this line - and rebuilding worked fine without any errors and was able to deploy solution successfully.
Note : testing this by putting the line back, and I get same error again on rebuilding.
It can be linked to using any android provider which creates the package for it, not necessarily AlarmClock only.
This error is, somewhat of, a wrapper for what can be multiple reasons that that the file was not created. The key is to look in the detailed output and look for the underlying error causing the file creation failure.
In my case, I had corrupted icon.png files (generated right from from the VS xamarin nunit template, no less!). Once I put in valid png files, everything was built fine.
Another reason for this error, if that the android NDK (not android SDK) isn't right, change de version can resolve the problem: go to Tools/Options/Xamarin/android Configurator and change de folder, in my case I've three, the last one can't compile, but the second folder with version xx.r11c do it.
For me it was Target Android Version.I had it set to
but changing it to Compiling version(for me it was the latest platform) resolved the issue.
So, I coded my entire app in Android 4.0.3. I used AmbilWarna color picker. Then I got this requirement to reduce the SDK requirement for Android 2.3. This is the point when EVERYTHING was working fine and superb
I have downgraded teh minimum SDK requirement. Everything runs fine except as soon as I include Ambil Warna as a library on my project, I start getting the error everywhere R is used, Saying that R cannot be resolved to a variable.
Upon a loot on the Console, this is what seems to be the real cause of the problem:
AmbilWarna\res\layout\ambilwarna_dialog.xml:18: error: No resource identifier found for attribute 'layerType' in package 'android'
I have set the Android SDK to 3.2 for AmbilWarna library project and on my project its at 2.3
Does anyone have any idea?
this is regarding this: http://developer.android.com/reference/android/view/View.html#attr_android:layerType
you are just trying to use a property for android that is not available on that api of the layout parser.
I just checked out the colorpicker code you are trying to use, and it's project.properties says it's written for target API-17 (android 4.2) and i'm tryng to compile it for API-10 (android 2.3.3)
simply remove those parts.
my diff
--- a/AmbilWarna/res/layout/ambilwarna_dialog.xml
+++ b/AmbilWarna/res/layout/ambilwarna_dialog.xml
## -19,7 +19,7 ##
android:id="#+id/ambilwarna_viewSatBri"
android:layout_width="#dimen/ambilwarna_hsvWidth"
android:layout_height="#dimen/ambilwarna_hsvHeight"
- android:layerType="software" />
+ />
and hope it's not mentioned in the code :)
I've had a lot of troubles too with my external libraries. What usually helped are one of these or multiple steps of these connected:
Delete ALL R.java imports in your Classes (there must not be any of them)
In Eclipse: Source => "Clean Up"
In Eclipse: Project => "Clean..." (This will rebuild your project from scratch and therefore regenerate your R.java)
Manually delete all R.java and save (located in /gen/)
Delete your external library project and readd it.
Step 3 usually did the job for me.
Also be aware that your minSdkVersion and targetSdkVersion fit to your library project (and the guidelines which are included)
I had the same problem, I thought I could just build and include the third party jar file and bring this over to my project - this resulted in the same problem as you - AmbilWarna\res\layout\ambilwarna_dialog.xml error: No resource identifier found for attribute 'layerType'.
To fix it I copied over the source files and all resources into my project (images/layouts etc etc), hey presto it worked.
Thanks http://code.google.com/p/android-color-picker/ for a nice clean easy to use colour picker!!
I've been having a problem with obfuscating my code using ProGuard. I've tried all the suggestions on the other, similar questions on here and still it doesn't work.
Essentially, here are all the facts I can glean from the situation:
My libraries are set up so that ViewPagerIndicator is referenced by ActionBarSherlock, which in turn is referenced by FormulaeLib which is referenced by the app, FormulaePro.
trying to use ant also fails, with errors at <sdk_dir>/tools/ant/build.xml lines 485, 602 and 622
commenting out the proguard configuration in project.properties will give a successful build.
I'm using ProGuard 4.7
UPDATES:
I've now traced this problem back to my CursorLoader implementation. I've had so many problems with this, I have now just gone back to using the (deprecated) managedQuery(..) method of loading cursors.
The end of the console output:
[2012-01-06 17:45:07 - FormulaePro] applyFileOverlay for mipmap
<lots of "new resource id" things>
[2012-01-06 17:45:43 - FormulaePro] (new resource id view from D:\Dropbox\Android\FormulaeLib\res\menu\view.xml)
[2012-01-06 17:45:43 - FormulaePro] Writing symbols for class R.
[2012-01-06 17:45:43 - FormulaePro] Writing symbols for class R.
[2012-01-06 17:45:43 - FormulaePro] Writing symbols for class R.
[2012-01-06 17:45:43 - FormulaePro] Writing symbols for class R.
[2012-01-06 17:45:45 - FormulaePro] Starting full Package build.
[2012-01-06 17:45:45 - FormulaePro] Skipping over Post Compiler.
So, can someone much cleverer than me figure out what the heck is going on?
Have you recently upgraded to SDK Tools rev 14 or higher?
I am not cleverer than you are, but the problem you are describing reminds me of my recent awful experience with Dalvik error 1.
If this is the case, try this solution from the amazing #TheTerribleSwiftTomato:
In your app project, check for any linked source folders pointing to your library projects (they have names in the form "LibraryName_src").
Select all those projects, right-click, choose "Build Path"->"Remove from Build Path".
Choose "Also unlink the folder from the project", and click "Yes".
Clean, rebuild and redeploy the project.
Update: Another scenario I recently encountered: You renamed one of the classes. In that case, the files generated in the proguard folder (dump.txt, mapping.txt, seeds.txt, usage.ext) may not reflect that change. In that case, delete all 4 of them. They will automatically generated next time you use the File > Export - this time not generating the dreaded "Dalvik error 1".
Good luck!
Besides the points refered by #Bill The Ape, have you upgraded your proguard files after updating the SDK?
That can be the problem, check out here: https://stackoverflow.com/a/7386541/327011
I recently had an error with proguard after updating the Android SDK... I kept getting an "Error 1" issue as well. What fixed it for me was downloading the latest proguard binaries and replacing the ones that came with the Android SDK.
Hopefully this helps for all of you as well...
http://sourceforge.net/projects/proguard/files/
Please Remove library & Once again Configure build path then the Dalvik Virtual Machine Error will be removed.
Try to Fix properties to 1.6 Compiler Once again.
Try it will resolve your issue!!!
i also got same problem when i upgraded to ADT 16 yesterday. To solve problem I removed ADT 16 and installed ADT 15.
Try this. This might solve your problem
I am about to release an application but, while i was building it using Export Tool of Android SDK in Eclipse, i get the error below.
I didn't change the proguard.cfg.
It is in the root folder of my project.
I only add proguard.config=proguard.cfg to default.properties.
I read the forum and update proguard (just copied the files to the tools folder of Android SDK), but still I doesn't work. I couldn't figure out what the problem is with the 'Projects\Eclipse' ??
If you help me, I will be so glad...
[2011-08-08 02:32:46 - CoolProject] Proguard returned with error code 1. See console
[2011-08-08 02:32:46 - CoolProject] proguard.ParseException: Unknown option 'Projects\Eclipse' in argument number 9
[2011-08-08 02:32:46 - CoolProject] at proguard.ConfigurationParser.parse(ConfigurationParser.java:172)
[2011-08-08 02:32:46 - CoolProject] at proguard.ProGuard.main(ProGuard.java:484)
Yeah that is right, but also I did something that I didn't know :)
My solution was:
I updated to latest Android SDK.
I changed SDK path property under Eclipse: Window > Preferences > Android > SDK Location as something like c:\Progra~1\android-sdk. The Progra~1 can be used for writing Program Files witout spaces. You can use DIR /X command in command prompt on Windows to get no space versions of Paths.
I moved my Eclipse Workspace to a location without spaces like D:\
The changes above didn't enough to solve the problem. I got "Conversion to Dalvik format failed with error 1" error dialog witout any explanation on output console. Then I found that topic and did what that reply says.
Then it worked ;)
I am using Windows 7 Ultimate x86. I hope it works for others too.
Arda.
Your project path probably contains a space. This should be fixed in the latest version of the Android SDK (at least for the Ant build). Otherwise, you should use a path without spaces for the time being.
After performing a Menubar> Project> Clean...
I get the following error in the errorlog:
Java Model Exception: Java Model Status [gen [in MyApp] does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
at org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:477)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:645)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:791)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:734)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:124)
at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1557)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1547)
at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1381)
at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1357)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1958)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Any ideas if this is a problem and what is causing it?
It occurs whether I Clean just my project or all projects
Frink
My Development Environment is:
Eclipse 3.5.2 with ADT 0.9.7 (2.1) and Java SDK 6 Update 21
32bit Windows XP VirtualBox VM on 64bit Windows 7
AMD Phenom II X4 955 Processor #3.20GHz with 4GB RAM
Had a similar error for different reasons. My error started after renaming the target package in the project. After I tried the solution from paskster without success, I started diggin'.
The actual problem was that renaming the package name from the manifest file didn't work as expected. I thought it would change everything everywhere. However, the old package name was still in the manifest file in the test directory, and in some views in the resources. After renaming those manually and rebuilding the project, the error was gone.
Try this, worked for me:
Delete the R.java file under the gen folder
Refresh the project
Build Project
Found here: http://www.joshuakerr.com/2009/10/23/android-and-the-missing-gen-folder/
I had the exact same problem.
Closing the AndroidProject, Restarting Eclipse and Reopening the AndroidProject solved the problem for me! Not at the first time, but after second or third time doing this, the error just disappered!
Weired thing is that by searching at google you pretty much only get this thread. So seems like it is a very new problem, maybe some update of the SDK that caused it.
You can check the Problems Tab in Eclipse.The Error was due to Java Build Path not configured.
You can set the environment variable in MyComputer settings as C:\Program Files\Java\jre6\bin and restart the eclipse. I hope it'll work for you as it worked for me :)
This worked for me.
Try right mouse clicking on Project (in Package Explorer)
Android Tools > Fix Project Properties
Project > Clean......
I was facing a similar problem and resolve it by manually building the projects that were causing the issue and then running clean all/build.
I have faced the same issue . I have tried all the solutions given ,but none of the solution is worked for me. Later I realized that I have changed my aapt.exe(provided with android sdk) with another aapt.exe .So, when I revert back the changes ,Issue is resolved automatically.Actually I was changing aapt.exe to aapt_real.exe and putting some other aapt.exe which is required for some specific project.So , be insure that your aapt.exe should be the same as given along with android sdk ie ADT. Also take care that the workspace name created in eclipse should not contain spaces. For eg workspace name should not be like that "new workspace". If space is there in eclipse workspace's name then it also causes the same error.So, In order to remove this error you have to create new workspace in eclipse without any space.