简体   繁体   中英

App crashes when I try to launch in Android Kitkat 4.4.4 but works fine in Android 5 & 6 versions

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)

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.

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.

**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); } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM