0

I got a NoClassDefFoundError when try to create an intent for a class which inherited from MapActivity.

here is the code where I got the exception: Intent mapTabIntent = new Intent(this, MapTab.class); Where this is the TabActivity

I tired with Android version 2.1 and 2.2 Google APIs. I put the manifest file outside the application: I used in manifest the android.permission.INTERNET too.

My application is works perfectly without the MapTab. I already recreate the MapTab class and maptab layout, the result is same.

What I missed out?

Laszlo
  • 1,279
  • 4
  • 19
  • 34

1 Answers1

0

check this question: https://stackoverflow.com/a/5719847/1317080 It seems your problem has to do with the vm not finding the google maps class you inherited from

Community
  • 1
  • 1
Mirko Lindner
  • 701
  • 5
  • 9
  • The maps.jar file is in Google APIs, project properties Java build path libraries – Laszlo Apr 09 '12 at 18:23
  • can you post the complete logcat output? – Mirko Lindner Apr 09 '12 at 18:37
  • I put the outside of application in the manifest file. If I put it between ... I got another error: requires unavailable feature android.hardware.sensor.light; failing! and my app didn1t started. I use light sensor and I defined the usage it. – Laszlo Apr 09 '12 at 18:41
  • i just tried it myself with api level 10 including google apis. I subclassed from MapActivity. Added INSIDE the application tag and declared the activity also INSIDE the application tag. The hardware feature is unrelated. – Mirko Lindner Apr 09 '12 at 18:57
  • LogCat: E/dalvikvm(248): Could not find class 'com.ekl.mobile.apps.gtl.MapTab', referenced from method com.ekl.mobile.apps.gtl.Main.onCreate E/AndroidRuntime(248): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime(248): java.lang.NoClassDefFoundError: com.ekl.mobile.apps.gtl.MapTab E/AndroidRuntime(248): at com.ekl.mobile.apps.gtl.Main.onCreate(Main.java:1249) 1249. line: Intent mapTabIntent = new Intent(this, MapTab.class); – Laszlo Apr 09 '12 at 18:57
  • that is exactly the error you'd get when the line is missing in your application tag in your manifest file – Mirko Lindner Apr 09 '12 at 19:03
  • I put it into application tags and I got another error. Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY E/PackageManager(52): Package com.ekl.mobile.apps.gtl requires unavailable shared library com.google.android.maps; failing! – Laszlo Apr 09 '12 at 19:10
  • The previous error fixed automatically and I got again the feature error: Installation error: INSTALL_FAILED_MISSING_FEATURE com.ekl.mobile.apps.gtl requires unavailable feature android.hardware.location; failing! BUT if I remove all MapView related lines from manifest/uses-library/ and the tab creation for MapView, it forks perfectly. It's strange... – Laszlo Apr 09 '12 at 19:42
  • do you test on an emulator or a device without a gps chip? try setting this in your manifest – Mirko Lindner Apr 09 '12 at 21:17
  • I got a same error with set to false on emulator on device I not tried. I tested without MapView on device and emulator it works perfectly. With MapView not works at all. – Laszlo Apr 10 '12 at 06:45