2

On running Android app FileNotFoundException is thrown and it says that classes.dex file does not exist(in the Problems tab in eclipse).

*Error:*
> Description   Resource    Path    Location    Type Error generating final
> archive: java.io.FileNotFoundException: D:\B040\Dec
> 31\AirTest\bin\classes.dex does not
> exist AirTestActivity     Unknown Android Packaging Problem

I have been stuck up on this since the last 2 days. The package explorer does not give any error(red cross on project). All other projects work fine. Only this imported project - Airpush sample is not running. The same code works fine on a different system. Need help in this.

Padma Kumar
  • 19,893
  • 17
  • 73
  • 130
devLearner
  • 21
  • 1
  • 3
  • delete the bin folder and then clean the project, run it. – Ahmad Dec 31 '12 at 19:58
  • did that. didn't work. Its not going upto the logcat stage. its not starting at all. "Your project contains error(s). Please fix them before running"- this is the alert I am getting when I try to run. – devLearner Dec 31 '12 at 20:07
  • Look for errors in your build path. – Ahmad Dec 31 '12 at 20:28
  • [Read this maybe](http://stackoverflow.com/questions/2865577/android-eclipse-error-android-packaging-problem) . Or create a new project copy over the java files and you get a fresh start – Erik Dec 31 '12 at 21:04
  • @Ahmad: There are no errors in the build path .. I am completely lost.. – devLearner Dec 31 '12 at 21:07
  • @Erik: Tried almost everything mentioned there- right from cleaning to opening the project in a new eclipse. Problem still persists. Anyways thanks. Let me know if you have something else in mind. – devLearner Dec 31 '12 at 21:11
  • Go into Eclipse Preferences and on the first page you see "restore default" ...dunno – Erik Dec 31 '12 at 21:22
  • Create a complete new workspace copy over the java files to a new project in the fresh workspace, happy new year :) – Erik Dec 31 '12 at 21:28
  • btw, post your activity code will always trigger better answers – Erik Dec 31 '12 at 21:56
  • Happy New yr :) . I have already ported the code to a new workspace but that didnt solve d issue. the same code (without any changes whatsoever) works in my friends pc. all codes except this one work fine in my system. – devLearner Dec 31 '12 at 23:18

1 Answers1

0

When I ran into this problem, I did as the previous poster has suggested by deleting bin, doing a "ant clean", then "ant debug" to build a debug version using the command line. And by looking at the output I saw that my problem is that I did not have my path setup properly under MS Windows so that java.exe is not found:

-dex:
  [dex] Converting compiled files and external libraries into d:\Misc\aarddict-android\bin\classes.dex...
   [dx] 'SearchForJava' is not recognized as an internal or external command,
   [dx] operable program or batch file.
   [dx] 
   [dx] WARNING: Java not found in your path.
   [dx] Checking if Java is installed in C:\Program Files\Java.
   [dx] 
   [dx] ERROR: No suitable Java found. In order to properly use the Android Developer
   [dx] Tools, you need a suitable version of Java JDK installed on your system.
   [dx] We recommend that you install the JDK version of JavaSE, available here:

Modifying path then solved the problem for me.

tst
  • 479
  • 4
  • 7