8

Whenever i am trying to run my project, i am getting this error in the console. "Could not find **.apk"

Operating system: windows XP

IDE: Eclipse SDK Version: 3.4.2 Build id: M20090211-1700

Android: 1.6

ADT: ADT 10.0.0

FYI: it is only happening with a single project, other projects are running fine..

mudit
  • 25,306
  • 32
  • 90
  • 132
  • @Saurabh Agnihotri That doesn't help. See http://stackoverflow.com/questions/6337673/could-not-find-library-apk – an00b Jun 13 '11 at 23:57

11 Answers11

14

I think this can happen when you rename the library project out from underneath the dependent project. Eclipse is reasonably good about about updating dependencies in most cases but this one seems fragile.

First try removing and then re-adding your library in Project > Properties > Android > Library.

If that doesn't work try cleaning your projects, exiting Eclipse, and opening the ".classpath" file in your project's root directory. If you see a line that references your library project under a previous name, just delete it, save the file, and relaunch Eclipse. Build the library project and then your dependent one. You may need to re-add the library like I mentioned above. This is what worked for me at least.

Edit note: I also found some stale references in my .project files. They didn't seem to be causing any problems but I removed them too. If you do that, be sure to search for the old name in that file as there was a whole "link" section near the bottom that also referenced it.

Melinda Green
  • 2,100
  • 1
  • 21
  • 32
  • 1
    In my case I had the "library project" added as a library under "Java Build Path", I removed that and added properly under Android > Library. This solved the warning – Gavriel Jun 05 '13 at 09:51
  • I also had to uncheck the "Is Library" checkbox. – Mike Lowery Apr 01 '14 at 02:26
7

Make sure after updating your android sdk sdk build tools are updated properly. You can check it by Open sdk manager -"Android Sdk Build Tools" status must be installed. if the status is not installed then install Android Sdk Build Tools for the same.

prakash singh
  • 101
  • 1
  • 9
  • Got the same error as mentioned above, after updating ADT to 22 from .zip file, because eclipse update was not working and Android Sdk Build Tools was indeed marked as not installed. Thank you! – Riplexus Jul 01 '13 at 07:27
0

Run eclipse as administrator and then import your project

ag0702
  • 381
  • 1
  • 6
  • 18
0

Update Android SDK, is what did it for me.

I was building a game with the LibGdx Framework and got the same error. I tried several solutions from various posts at stackoverflow and others.

Found help in a post at the LibGdx Forum:

http://www.badlogicgames.com/wordpress/?p=3010 Posted by Mario, on May 18, 2013

Just updated to ADT 22, so should you. However, the process wasn’t all that smooth. What you need to do:

  • Update the ADT plugin in Eclipse (Help -> Check for Updates)
  • Open the Android SDK Manager, either from within Eclipse, or from your Android SDK folder
  • Fetch all the updates
  • Fetch all the updates again
  • Fetch the updates one more time…

The end result should be an updated ADT plugin, as well as up to date SDK packages. Make sure you have all three of the ones in the following image, with the exact version numbers.

I needed to update them only once and from there on it worked. Even if this post is outdated I figured I'll share this, because I lost a day finding nothing.

Frank
  • 1,535
  • 1
  • 11
  • 13
0

I experienced that problem, too, when I created an android project that was using an android library. Obviously I didn't know how to incorporate a library into an application the right way. I wrongly used project dependencies (Java Build Path/projects) or adding a library (Java Build Path/Libraries). While all I had to do was go to the Android tab and import my android library by means of the add button from the Library section.

Jens Mander
  • 430
  • 7
  • 15
0

I am using PhoneGap and I checked several solutions about configuration (properties, build path). However, my problem was that I tried to run everything with the default setup for Eclipse. Then, I solved it going to the SDK manager to install: Android SDK Build-tools, and it worked.

ericson.cepeda
  • 1,875
  • 2
  • 16
  • 15
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
Community
  • 1
  • 1
ED-209
  • 4,706
  • 2
  • 21
  • 26
0

restart your eclipse and try again

check this it might be helpful to you

Sunil Pandey
  • 7,042
  • 7
  • 35
  • 48
0

clean your project and check . eclipse is not building apk file.

check this thread. It might help you.

http://groups.google.com/group/android-developers/browse_thread/thread/2c3e45540b915945/f06e10bcda3ad68b?lnk=raot&pli=1

sat
  • 40,138
  • 28
  • 93
  • 102
  • eclipse is building an apk file but eclipse is unable to find it or whatever.. plus when i try to install the apk using command line tools, i am getting following error message: "not a valid zip file" – mudit Mar 11 '11 at 13:06
  • 1
    That doesn't help. See http://stackoverflow.com/questions/6337673/could-not-find-library-apk – an00b Jun 13 '11 at 23:57
0

Make sure your project imported the Android 1.6 library correctly. That is, under your project, you should see 'Android 1.6', which expands and displays 'android.jar'.

If it says Referenced Libraries > android.jar, you will need to fix this by manually altering the .classpath for the project.

Open .classpath for the project and type the following:

The important line is the 3rd classpathentry, which is the actual link to the Android SDK libraries.

source

AhmadAssaf
  • 3,556
  • 5
  • 31
  • 42
-1

Make sure put correct SDK Location (I have 2 instances of SDK and update wrong once).

ego
  • 1