0

I am new to android, and i am unable understand what exactly going on here, app works fine Android 5 & 6 but crashes in Android 4(KITKAT)

03-13 13:11:44.925 10802-10840/? E/GoogleConversionPing: Error sending ping 03-13 13:11:45.145 3289-3497/? E/NetworkScheduler.SR: Invalid parameter app 03-13 13:11:45.145 3289-3497/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras? 03-13 13:11:45.228 10802-10802/? E/WifiManager: mWifiServiceMessenger == null 03-13 13:11:46.710 650-650/? E/RemoteViews: ANR Warning,RemoteViews can only be used once ,if not ,it may cause ANR in hosts such as Laucher,SystemUI. keys for search <ANR Exception MSG   History> 03-13 13:11:46.741 650-650/? E/NotificationService: unable to notify listener (posted): android.service.notification.INotificationListener$Stub$Proxy@4249a880
                                                    android.os.DeadObjectException
                                                        at android.os.BinderProxy.transact(Native Method)
                                                        at android.service.notification.INotificationListener$Stub$Proxy.onNotificationPosted(INotificationListener.java:102)
                                                        at com.android.server.NotificationManagerService$NotificationListenerInfo.notifyPostedIfUserMatch(NotificationManagerService.java:264)
                                                        at com.android.server.NotificationManagerService$2.run(NotificationManagerService.java:837)
                                                        at android.os.Handler.handleCallback(Handler.java:808)
                                                        at android.os.Handler.dispatchMessage(Handler.java:103)
                                                        at android.os.Looper.loop(Looper.java:193)
                                                        at com.android.server.ServerThread.initAndLoop(SystemServer.java:1447)
                                                        at com.android.server.SystemServer.main(SystemServer.java:1542)
                                                        at java.lang.reflect.Method.invokeNative(Native Method)
                                                        at java.lang.reflect.Method.invoke(Method.java:515)
                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
                                                        at dalvik.system.NativeStart.main(Native Method) 03-13 13:11:53.368 650-1010/? E/CellLocation: create GsmCellLocation 03-13 13:11:53.398 650-650/? E/CellLocation: create GsmCellLocation 03-13 13:11:53.608 650-825/? E/CellLocation: create GsmCellLocation 03-13 13:11:53.636 650-650/? E/CellLocation: create GsmCellLocation 03-13 13:12:01.735 650-650/? E/RemoteViews: ANR Warning,RemoteViews can only be used once ,if not ,it may cause ANR in hosts such as Laucher,SystemUI. keys for search <ANR Exception MSG   History> 03-13 13:12:01.743 650-650/? E/NotificationService: unable to notify listener (posted): android.service.notification.INotificationListener$Stub$Proxy@4249a880
                                                    android.os.DeadObjectException
                                                        at android.os.BinderProxy.transact(Native Method)
                                                        at android.service.notification.INotificationListener$Stub$Proxy.onNotificationPosted(INotificationListener.java:102)
                                                        at com.android.server.NotificationManagerService$NotificationListenerInfo.notifyPostedIfUserMatch(NotificationManagerService.java:264)
                                                        at com.android.server.NotificationManagerService$2.run(NotificationManagerService.java:837)
                                                        at android.os.Handler.handleCallback(Handler.java:808)
                                                        at android.os.Handler.dispatchMessage(Handler.java:103)
                                                        at android.os.Looper.loop(Looper.java:193)
                                                        at com.android.server.ServerThread.initAndLoop(SystemServer.java:1447)
                                                        at com.android.server.SystemServer.main(SystemServer.java:1542)
                                                        at java.lang.reflect.Method.invokeNative(Native Method)
                                                        at java.lang.reflect.Method.invoke(Method.java:515)
                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
                                                        at dalvik.system.NativeStart.main(Native Method)
Ahmer Afzal
  • 501
  • 2
  • 11
  • 24

3 Answers3

0

EDIT: OP mutated the question since it was answered, so this answer does no longer apply.

The class android.app.job.JobScheduler was added in API level 21 (Android 5.0). It is therefore clear that the app would crash on earlier Android versions.

Henry
  • 42,982
  • 7
  • 68
  • 84
0

JobScheduler isn't backported, however, there's the Firebase JobDispatcher that supports the same API and is backported via Google Play Services.

The Firebase JobDispatcher is a library for scheduling background jobs in your Android app. It provides a JobScheduler-compatible API that works on all recent versions of Android (API level 9+) that have Google Play services installed.

marmor
  • 27,641
  • 11
  • 107
  • 150
  • so, whats the solution i should be doing? Thanks in advance and i am using FCM Notification in my app too is it related to it ? – Rakesh Gowda Mar 13 '17 at 07:03
  • see https://github.com/firebase/firebase-jobdispatcher-android#installation on how to add dependency to the new JobDispatcher, and see https://github.com/firebase/firebase-jobdispatcher-android#usage on how to use it. It's very similar to using `JobScheduler`. You can post your current code in your question if you need more specific help. – marmor Mar 13 '17 at 07:24
  • oh, and it's not related to FCM Notifications, but they're both part of the same firebase framework. – marmor Mar 13 '17 at 07:25
0
**If your minSdkVersion is set to 21 or higher, all you need to do is set multiDexEnabled to true in your module-level build.gradle file, as shown here:**

android {
defaultConfig {
    ...
    minSdkVersion 21 
    targetSdkVersion 25
    multiDexEnabled true
}``
...

}

dependencies { compile 'com.android.support:multidex:1.0.1' }

 public class MyApplication extends MultiDexApplication { ... }

Application extends SomeOtherApplication { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } }

Umesh Raj
  • 29
  • 1
  • 2