score:603

Accepted answer

please follow these steps; this might help you out:

  1. right-click your app project and go to properties

  2. select android from left-hand side list

  3. uncheck the "is library" checkbox

if your app project relies on library projects which are in your workspace, those of course need to have the "is library" box checked.

score:0

the problem for me was i was trying to use ibm rad which appears to not work properly for this, i installed eclipse and now have a different error but i should be able to get past it

score:0

on my machine (windows7, 64bit) i could fix this by setting my execution environment to a 32bit variant of the jdk (i used 1.6.0_23). and i tried a lot of things before...

score:0

sha1's answer did it for me: after updating to the latest sdk/adt, my project refused to build an apk; unchecking the option resolved the issue.

i don't know if the update checked this, or if it was checked before but the new adt screwed things up, but things work again now :)

score:0

in my case this worked :

delete r.java file in /gen folder

+

delete all "r.android" imports that eclipse added to some of my java classes !!!

and rebuild the project.

score:0

remove -- r.java -- clean the project and run again.. this worked for me ..

score:0

find the project's folder in your system, enter it's properties via context menu and deselect "read only" option. worked in my case.

this seems to be the source of the problem in many cases, moreover some solutions up there base on copying/rewriting the files in the project what makes them non-read-only.

score:0

this is caused by java_home not being set correctly. it can be easily resolved by following the steps in this article.

score:0

mine was caused by this problem (incompatibility between adt and sdk), and was fixed thus:

  • eclipse > help
  • install new software
  • add 'https://dl-ssl.google.com/android/eclipse/' to 'work with' section and press enter
  • after developer tools appears on the list, check it and click next
  • restart eclipse once download is finished

score:0

i my case, i had to switch from api 21 to api 19, clean and build and everything was fine again. i am using a mac and apparently api 21 is not fully supported on yosemite.

score:1

i figured it out. i was referencing javase-1.5 and using jdk 1.6. i changed it to use 1.6 and that appears to fix it.

seems like through my research that is an overloaded error message that covers a lot of error cases.

score:1

i just fixed this by reselecting a default jre for the execution environment (jre6 for javase-1.6 in my case). it got unchecked for some reason.

score:1

this fixed my problem. i kept getting the console error in eclipse "could not find com_android_vending_licensing.apk" and even though it didnt seem to effect the way my app ran, it was annoying. so going into the com_android_vending_licensing project properties and unchecking the "is library" option, building the project to produce the needed apk and then going back into the com_android_vending_licensing project properties and re checking the "is library" check box fixed the problem.

score:1

run eclipse as "administrator" and then import the project.

score:1

none of these things worked for me. i'm trying to access native code through the jni, first with ndk samples. what i found was the build won't run if jarlist.cache is not present in the project bin directory. if i copy one from another project to that location (may need to refresh to see the folder in eclipse), build works every time.

score:1

clean the project and it will do. sometimes it happens unknowingly but keep trying to solve using diff methods.

score:1

i had somehow done a run configuration as a java application instead of a android.

score:2

i'm no expert, but eclipse on windows, doing android apps, refuses to create the default.properties file (in the app root directory). i've just copied one from another app and it works fine. simple contents, for android 2.2 project it just says (ignoring comments):

target=android-8

fwiw

score:2

i was having the same issue as the op except that all these suggestions did not work. i found a solution for me.

make sure that "skip packaging and dexing until export or launch." is selected.

go to window -> preferences -> android -> build. just make sure that option is selected and apply.

i know this does not make a lot of sense, but having it unselected was giving me this error and with it selected it goes away and the apk is installed.


i am using the auto generated ant build script from android and only using it as my build process in eclipse. i am not using any other build methods.

score:5

delete the project from your workspace & import again.
this worked for me.

can't believe similar issue has been there since 2008.
http://code.google.com/p/android/issues/detail?id=834.

score:8

i've tried to gather the best of other peoples answers into a step by step list of things to try in order:

  • check the project is not set as a library:
    1. go to project->properties
    2. select android from left-hand side list
    3. uncheck the "is library" checkbox
  • clean and rebuild the project - this should delete and recreate the entire gen folder, including the r.java file mentioned in some peoples answers
  • check eclipse and all the android plugins are up to date
  • close the project, exit eclipse, reopen eclipse, reopen the project.
  • go to java build path > projects and check for any incorrect project dependencies
  • go to the main preferences for eclipse and under android->build uncheck 'skip packaging and dexing until export or launch'
  • check java_home is set correctly. follow the steps in this article

if you complete the above list, and still haven't solved the issue, please leave a comment, or if you find something else that works, feel free to edit the answer and add your thing in.

score:12

in my case this problem started after eclipse updated the plugin with the v4.0 api release. i fixed it by going to the main preferences for eclipse and under android->build uncheck 'skip packaging and dexing until export or launch'

note: if you eclipse gives you the unknown command 'crunch' error then follow this post

score:16

i tried all the above solutions. but it didn't work.

the solution was to restart eclipse !!!!!!!

hope this will help someone :)

score:24

deleting the r.java file in /gen folder did the trick for me


Related Query

More Query from same tag