簡體   English   中英

當我嘗試在Android Kitkat 4.4.4中啟動時,應用程序崩潰,但在Android 5和6版本中正常運行

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

我是android新手,我無法理解這里到底發生了什么,該應用程序在Android 5和6上運行良好但在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)

編輯:OP改變了問題,因為它已經被回答,所以這個答案不再適用。

API級別21(Android 5.0)中添加了類android.app.job.JobScheduler 因此很明顯,該應用程序將在較早的Android版本上崩潰。

JobScheduler沒有被JobScheduler移植,但是有Firebase JobDispatcher支持相同的API,並通過Google Play Services 反向移植。

Firebase JobDispatcher是一個用於在Android應用中安排后台作業的庫。 它提供了與JobScheduler兼容的API,該API在安裝了Google Play服務的所有最新版本的Android(API級別9+)上均可使用。

**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
}``
...

}

依賴項{編譯'com.android.support:multidex:1.0.1'}

 public class MyApplication extends MultiDexApplication { ... }

應用程序擴展了SomeOtherApplication {@Override protected void attachBaseContext(Context base){super.attachBaseContext(base); MultiDex.install(this); }}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM