开发者

resources.ap_ does not exist when compile my android project

Compile Error: Error generating final archive: java.io.FileNotFoundExcept开发者_运维知识库ion: ..\bin\resources.ap_ does not exist.

Compile other simple sample works. Same source file and project works on my college's machine.

Any tips ? Why resources.ap_ doesn't get generated ?


Did you do a Project > Clean? If that doesn't work, try forcing Eclipse to build the project again. Restart Eclipse if that still doesn't work.


I created an empty text file under C:\Users\me\workspace\project\bin\resources.ap_

Then Cleaned/Rebuild... that seemed to fix it.


In my case was a 9 patch drawable that was modified with GIMP, then adb cannot "parse" it, recreated with the draw9patch then worked fine


I was getting both the error in this thread and the one in this post: Android Unknown Command 'crunch'.

Updating the Android SDK inside Eclipse fixed both errors for me.


If you delete the whole "gen" folder, then go to Project>Build All it seems to regenerate the folder and the R.java file


Finally i found the reason. The update aapt tool treat the format string without order as build error. e.g. "%s %d" should be "%1$s %2$d".


I got this along with an error when the "aapt.exe" update tool was run.

There's apparently a bug in this program when the console build output is set to "Verbose". Changing it to "Normal" fixed it for me.

See this link:

aapt.exe is throwing unhandled exception while building *.apk file for Android project in Eclipse


Try going to Window->Android SDK manager and update Tools and Android 4.0. This solved my issues.

If that doesnt work, try updating everything.

That totally worked for me!

Reference: Error generating final archive: java.io.FileNotFoundException: xxx\bin\resources.ap_ does not exist


Delete bin and gen directories from system. Then F5 in eclipse.
This helped me. Nothing else worked for me.


For me, it was turning off Instant Run.

Preferences -> Build, Execution, Deployment -> Instant Run -> uncheck "Enable Instant Run to hot..."

Also, I heared killing a goat and draw a pentagram on the office floor with its warm blood helps prevent these kind of problems.


i tried the Notepad Tutorial Exercise 2 and got the same error. i used the wrong API-Level (3). i just switched to level 8 and now it's working fine.


This problem occurred for me after eclipse did some updates. I just went to a backup of my project and took the file that and placed it in the appropriate place in my current project and all worked.


Goto file->Properties and change the target to the correct version of android. For me it was 1.5 (from the tutorial on hack-a-day)


AndroidManifest.xml displayed within Eclipse was out of sync with what was on disk/being read by Android. shutdown restart eclipse and edit AndroidManifest.xml to be correct and clean and build.

Happens due to having two AndroidManifest.xml files and renaming them. Two useful if two apps from same code base. Linking projects with Android is problematic.


I had both values and values-en folders and it was picking the string from the values-en folder. I deleted the en folder and it was back to normal.

I tried

  1. Clean
  2. Delete gen
  3. restart eclipse


Here are a few of the things I did that made this finally work for me.

1) I was using Admob ads, and I didn't have an attrs.xml file in my res/values folder

2) I deleted a line that says "import andriod.R" from my main activity, and all my resources connected again and this ultimately made the error go away.

3) The last thing I had wrong is I had a "lib" folder instead of a "libs" folder that held my Admob jar file.

Lastly, I cleaned the project after these changes.

So, hopefully this helps someone else having this same error if none of the above fix the problem.


I had the same problem and after digging around the different output Eclipse provides discovered that the issue had to do with a malformed 9-patch image.

I discovered the issue in the Problems output (Alt-Shift-Q then X).


I had the same error message and it was caused by having a backslash character in one of my string resource values (in the file: res/values/strings.xml).

I had to remove the offending character and clean the project before it would build.


1 - Try Project > Clean and rebuild project

2 - If clean does not solve this issue, check ALL log in your Console view in Eclipse.

The issue may not be reported at the end of the Console view. In my case, it was a drawable that does not respect the 9-patch format. This was reported somewhere in the Console view but not at the end !!!


Delete any 9 patch drawables created in gimp and refresh.


  1. Delete bin and gen on filesystem.
  2. Refresh (F5) project in Eclipse.


I faced the same issue. And I fixed it by removing newly added png file. It was not able to generate resources.ap file because of one of my png file in drawable.


I got this problem after the upgrade to Android SDK Tools 15. It was also related to the PNG image as some other replies indicate. After analyzing the Eclipse Console output I found out that the process aapt.exe is crashing while processing of one of the images. More precisely it was in the step labeled as "Including resources from package". To identify the file causing the problem I scanned the Console output, found 3 calls of aapt.exe and each of them I re-ran in the Windows Console. The third one ("aapt.exe package -v -S ...") crashed on one of my PNG files. After I replaced this file (in all supported resolutions) the problem has gone.


If you use SurfaceView and have recently changed the name of the package, you might want to check any XML tags that refer to the class.


first try

clean,build automatically from eclipse

and if not resolved then try uder solution

i found solution why R.class not made by eclipse after making again-2 clean,build etc.

problem is here in strings.xml:

Hello World, HelloAutoComplete!

HelloAutoComplete these are by default created by the eclipse when you create an projects

definitly you are changing the strings.xml for your own requirment sometimes you cleare the string.xmls these two lines from your codes.

it is making problem in AndroidManifest.xml file

so it cant communicating strings.xml

dont delete these two lines from strings.xml

android:icon="@drawable/icon" android:label="@string/app_name"

android:name=".HelloAutoComplete"

android:label="@string/app_name"

regards aarifmohammadkhan@gmail.com

if any one have nay problem in android

welcome for asking questions

Regards aarifmkhan


You might need to remove extra files from your assets or res directory. One case I had was having both "A.jpg" and "A.JPG" files in the assets directory. It prevented the resources.ap_ file from being generated.


For Android studio, if you are using gradle 2.2.2 just disable shrinkResources into build.gradle file:

 shrinkResources false


Try run your Eclipse as administrator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜