NoClassDefFoundError: android.support.v4.util.ArrayMap

Getting this error in JellyBean:

01-11 18:26:52.030: E/AndroidRuntime(16517): FATAL EXCEPTION: main 01-11 18:26:52.030: E/AndroidRuntime(16517): java.lang.NoClassDefFoundError: android.support.v4.util.ArrayMap 01-11 18:26:52.030: E/AndroidRuntime(16517): at com.google.android.gms.common.api.GoogleApiClient$Builder.<init>(Unknown Source) 01-11 18:26:52.030: E/AndroidRuntime(16517): at com.example.services.LocationService.initGoogleApiClient(LocationService.java:82) 01-11 18:26:52.030: E/AndroidRuntime(16517): at com.example.services.LocationService.start(LocationService.java:73) 

The project is still using Eclipse.

There are two questions about this problem, resolved in ways that do not help my case:

Crashing with Android 4.1 using ArrayMap - I cannot change the Google code, which crashes in my case

Android error - caused by: java.lang.NoClassDefFoundError: android.support.v4.util.SparseArrayCompat - it is already marked but not working

+3
source share
3 answers

Often the problem with the missing android.support class means that you have an older version of the damaged library installed, one of which was before the class was added. Unfortunately, JavaDocs does a poor job of indicating which version of the support libraries has added new classes.

If you are using Android Studio, make sure your support- dependencies are up to support- and your compileSdkVersion matches the major version number of the dependency.

If you use Eclipse, you will have to not only download the latest libraries from the SDK manager, but then remove the old library from the Eclipse project and add the latest library from your SDK installation.

+6
source

This happened to me when I added the google-play-services_lib library project (from ASDK add-ons) to my IDE (IntellyJ Idea) in google docs. The library project refers to google-play-services.jar , which in turn needs a support bank-v4, but this dependency is not included in google-play-services_lib .

There was another warning in the log-cat that there were no support classes-v4.

Adding the support banner-v4 manually to the main application project resolved the problem.

0
source

Right-click on your project โ†’ Build Path โ†’ Configure Build Path โ†’ Order and Export Tab.

Make sure that โ€œPrivate Android librariesโ€ are checked for โ€œExportโ€.

If you added any libraries from the libs / folder, delete them, because they are automatically added to the "Private Android libraries" section.

Copy: fooobar.com/questions/100794 / ...

-4
source

Source: https://habr.com/ru/post/1015173/


All Articles