Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoClassDefFoundError: android.support.v4.app when sending push?

Im using PushBots to manage my push notifications for my app, I have been using this amazing platform for lots of apps and its the first time I have a problem like this.

Sometimes, when I launch the app, I get this error, but always when receiving a push (within or whitout the app opened).

07-12 01:20:00.844: E/AndroidRuntime(12140): FATAL EXCEPTION: IntentService[GCMIntentService-326*****5*9-1]
07-12 01:20:00.844: E/AndroidRuntime(12140): Process: com.karlol.mo***, PID: 12140
07-12 01:20:00.844: E/AndroidRuntime(12140): java.lang.NoClassDefFoundError: android.support.v4.app.NotificationManagerCompat

> //This is just the beginning of the log, there's more with some
> Pushbots handler info and stuff.... Let me know if I need to post it,
> its a lot.

Im pretty sure this is about the android support v4, this is my current build path:

Build Path

*Sometimes when I uncheck the Private Libraries clean and re-check this option again the app works (but not lucky with notifications).

The support v4 jar is in the libs folder, the route is the correct (MyApp/libs)

Im about to release an update, my app is already working/running with pushbots servers (with registered devices and all) so I would like to solve this to release my update. Thanks.

like image 710
Karlo A. López Avatar asked Jul 12 '15 06:07

Karlo A. López


2 Answers

As explained in these questions: NotificationManagerCompat Can't be resolved - Android Wear and Android studio unable to import WearableExtender NotificationManagerCompat and RemoteInput. It seems that you are not using the last version of the compatibility support library. You have two options to solve that:

  1. Download the newest libraries manually, and add them to your project.
  2. It seems that you are using eclipse, I recommend that you now use Android Studio so you can add the dependency and let gladle handle the libraries, like this

    dependencies {
        compile 'com.android.support:support-v4:20.0+'
    }
    
like image 114
gusridd Avatar answered Oct 12 '22 12:10

gusridd


check mark the following jars in build path or property ,it will work 1. android-support-v4.jar(appcombat/ibs) 2.android-support-v4-appcombat.jar(appcombat/ibs)

like image 41
Reprator Avatar answered Oct 12 '22 11:10

Reprator