[java] Android Eclipse - Could not find *.apk

I know this question has been asked before and I have seen a plethora of solutions out there, yet none seem to work for me. I was able to build my apk without issues until this error started cropping up. I have tried cleaning my project, removing it from the workspace and reimporting it, removing "Java Builder" from my Builders for the project, building the project manually, reordering my java build path. I have no visible compiler issues and no problems exist in my workspace.

I did experience this issue before and solved it once by removing the project form my workspace and re-importing it and another time I solved it by removing "Java Builder" from my java build path. None seem to work this time. I currently have most of the settings set back to default (i.e. java build is checked again).

I am running windows 7 (64 bit) and using jdk1.6.0_21 via Eclipse 3.6.

Any suggestions would be greatly appreciated as I have lost loads of development time troubleshooting this already.

[Update] My locale is English & I have tried removing the debug.keystore, United States as related to issue 834

This question is related to java android eclipse

The answer is


remove -- R.java -- Clean the project and run again.. this worked for me ..


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


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


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

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

The solution was to restart eclipse !!!!!!!

hope this will help someone :)


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.


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...


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.


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.


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


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.


deleting the R.Java file in /Gen folder did the trick for me


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 :)


This is caused by JAVA_HOME not being set correctly. It can be easily resolved by following the steps in this article.


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.


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.


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.


Run Eclipse as "Administrator" and then import the project.


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.


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.


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.


I had somehow done a Run configuration as a Java application instead of a Android.


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


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat