NoClassDefFoundError JsonAutoDetect while parsing JSON object

For those who come here in the future, the answer is: If you’ve only copied jackson core and jackson databind, you need jackson annotations to use the ObjectMapper. For example, make sure you have something like this: [16:32:01]:/android-project/libs master]$ ls -lAF total 2112 -rw-r–r–@ 1 jeffamaphone staff 33525 Jun 18 16:06 jackson-annotations-2.0.2.jar -rw-r–r–@ 1 jeffamaphone … Read more

Java ClassNotFoundException with maven dependency

Change provided to compile Provided This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because … Read more

NoClassDefFoundError: wrong name

Exception in thread “main” java.lang.NoClassDefFoundError: ClientREST So, you ran it as java ClientREST. It’s expecting a ClientREST.class without any package. (wrong name: clientrest/ClientREST) Hey, the class is trying to tell you that it has a package clientrest;. You need to run it from the package root on. Go one folder up so that you’re in … Read more

NoClassDefFoundError for code in an Java library on Android

I had the same issue, I did the following to fix the problem. Go to “Properties” of the project. Select “Java Build Path” Select “Order and Export” Tab You should see the selected project’s “src” and “gen” paths and dependencies here. The order how they listed were first “src” and then “gen” path I switch … Read more

Unable instantiate android.gms.maps.MapFragment

In IntelliJ IDEA (updated for IntelliJ 12): Create a file ~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/src/dummy.java containing class dummy {}. File->Import Module-> ~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib Create Module from Existing Sources Next->Next->Next->Next->Finish File->Project Structure->Modules->YourApp +->Module Dependency->Google-play-services_lib (The + button is in the top right corner of the dialog.) +->Jars or directories->~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar Use the up/down arrows to move <Module source> to the bottom of … Read more

java.lang.NoClassDefFoundError: android/graphics/drawable/Icon

Update The issue is fixed in support library 27.0.0. If you update don’t forget to change compileSdkVersion 27 as well. What is happening? Samsung devices with Android 4.4 crash like this when classes extending View define methods which return or take parameters of types that are not on classpath. Starting with support library version 25.4.0 … Read more

tech