kvnam
kvnam

Reputation: 1455

Importing libgdx project into Eclipse Juno error Cannot find .apk

I am just starting to learn Libgdx, and am in the process of importing the 4 projects[desktop, main java game, android, html] into Eclipse Juno. I have not added any lines of code, just trying to get them to run on the different platforms.

It runs fine on the desktop version, but when I tried to run it in the Android emulator I get the error. Cannot find mygdxgame.apk!

I realized that my gen folder is completely empty, there is no R.java for the project. I have tried a number of things to make this work, but none of it is working. I am listing the things I have tried so far, and the hopefully the reason why I am asking this repeatedly asked question.

  1. Project > Clean
  2. Package Explorer [right click on my project] > Android Tools > Fix Project Issues
  3. Deleted gen folder and Project > Clean
  4. Restarted Eclipse
  5. Deleted the project and Imported it again
  6. Set Compiler Compliance Level to 1.6 for both main java game and Android project
  7. Added a dummy XML to the android project and tried clean, and deleted it
  8. Unchecked and rechecked Build Automatically
  9. Checked my target-sdk in project.properties and made sure it is the same Project Properties -> Android and in my Manifest.xml
  10. [Right click on project] > Properties > Java Build Path > Source tab, Removed mygdxgame/gen folder and then added it again
  11. Made sure Project Properties > Android > Is Library is unchecked

Nothing has worked so far. My gen folder is still empty and I am unable to run the Android project because of the same error. Cannot find mygdxgame.apk!

What else can I do to fix this? In case this is answered I would appreciate someone giving me a link to the solution, as I have been pouring through SO and Google in general for nearly 2 hours now, with no success.

Regs

Upvotes: 1

Views: 3782

Answers (3)

Daahrien
Daahrien

Reputation: 10320

What happened to me a few days ago:

  • 1.- I got the SDK Tools 22 update and I installed it, no other update appeared in my sdk manager... so I closed it.

  • 2.- Then I got that "NO APK" error and tried every answer I could find.

  • 3.- I opened SDK manager again, and I noted SDK Platform Tools also got an update and there was a new one: SDK Build Tools. Both of them didn't show up when I first updated the SDK Tools.. so.

ANSWER:

Open SDK Manager and check if your SDK Tools, SDK Platform Tools, SDK Build Tools are updated :)

Upvotes: 6

Saj
Saj

Reputation: 18702

On your build path, you should have a reference to the main project, under Projects tab of Java Build Path. Under Libraries, you should have gdx-backend-android.jar and gdx.jar along with Android not being a library.

Please check if Android is set as a library. If so, uncheck it. To do that, right click on the project and then select Properties. Choose Android on the left panel of the new window. Uncheck Is Library if checked.

Here's something might help- Unable to run Android app, Could not find .apk issue in eclipse

Upvotes: 3

bemeyer
bemeyer

Reputation: 6221

I would take alook at your buildpath if all libs are correct. If it's a projekt from an other computer the libs are often at different places so you need to correct those manual. If they are not correct the android projekt do not generate your R. class and so on. So do rightclick on the core projekt -> Buidl Path -> Configure Build Path. Now take a look at the libs if all are there. I had the same issue with the android 15 apk so i need to add it manual. The clean or such do not fix such because eclipse can't know where you have all your libs.

If you really dont get it run i would recoment to use the setup ui of libgdx. It does noramlly handle all imports and so on for you. You can also use it to update your current projekt and so on.

Else i would read the guide for Manual Project Setup of Libgdx.

Libgdx setup Guide
I hope this does fix it.

Upvotes: 2

Related Questions