由于Cordova / Phonegap SplashScreen插件,我的应用程序在Android 4.2上崩溃了!
我的应用总大小为:5mb,我使用的是PhoneGap的默认启动画面!!我在模拟器和设备上测试了应用程序并遇到同样的问题,应用程序崩溃了
Cordova版本:
3.5.0-0.2.6
插件列表:
com.adobe.plugins.GAPlugin 2.3.1 "GAPlugin"
com.google.playservices 18.0.0 "Google Play Services for Android"
com.ionic.keyboard 1.0.2 "Keyboard"
com.phonegap.plugins.barcodescanner 2.0.0 "BarcodeScanner"
com.postmedia.DFPPlugin 0.0.2 "DFPPlugin"
com.pushwoosh.plugins.pushwoosh 3.2.0 "Pushwoosh"
it.mobimentum.phonegapspinnerplugin 1.1.0 "SpinnerPlugin"
nl.x-services.plugins.socialsharing 4.3.0 "SocialSharing"
org.apache.cordova.console 0.2.9 "Console"
org.apache.cordova.device 0.2.10 "Device"
org.apache.cordova.dialogs 0.2.8 "Notification"
org.apache.cordova.globalization 0.2.8 "Globalization"
org.apache.cordova.inappbrowser 0.5.0 "InAppBrowser"
org.apache.cordova.network-information 0.2.10 "Network Information"
org.apache.cordova.splashscreen 0.3.1 "Splashscreen"
org.apache.cordova.statusbar 0.1.6 "StatusBar"
org.pushandplay.cordova.apprate 0.0.23 "AppRate"
以下是来自eclipse logcat的日志:
08-02 12:11:57.279: D/dalvikvm(3599): GC_FOR_ALLOC freed 3K, 1% free 42575K/42744K, paused 2ms, total 2ms
08-02 12:11:57.279: I/dalvikvm-heap(3599): Forcing collection of SoftReferences for 92174412-byte allocation
08-02 12:11:57.289: D/dalvikvm(3599): GC_BEFORE_OOM freed 9K, 1% free 42566K/42744K, paused 11ms, total 11ms
08-02 12:11:57.289: E/dalvikvm-heap(3599): Out of memory on a 92174412-byte allocation.
08-02 12:11:57.289: I/dalvikvm(3599): "main" prio=5 tid=1 RUNNABLE
08-02 12:11:57.289: I/dalvikvm(3599): | group="main" sCount=0 dsCount=0 obj=0xb2d37938 self=0xb81d4e80
08-02 12:11:57.289: I/dalvikvm(3599): | sysTid=3599 nice=0 sched=0/0 cgrp=[fopen-error:2] handle=-1208110944
08-02 12:11:57.289: I/dalvikvm(3599): | state=R schedstat=( 0 0 0 ) utm=13 stm=3 core=0
08-02 12:11:57.299: I/dalvikvm(3599): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-02 12:11:57.299: I/dalvikvm(3599): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
08-02 12:11:57.299: I/dalvikvm(3599): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
08-02 12:11:57.299: I/dalvikvm(3599): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
08-02 12:11:57.299: I/dalvikvm(3599): at android.content.res.Resources.loadDrawable(Resources.java:1965)
08-02 12:11:57.299: I/dalvikvm(3599): at android.content.res.Resources.getDrawable(Resources.java:660)
08-02 12:11:57.299: I/dalvikvm(3599): at android.view.View.setBackgroundResource(View.java:14463)
08-02 12:11:57.299: I/dalvikvm(3599): at org.apache.cordova.CordovaActivity$5.run(CordovaActivity.java:1070)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.Activity.runOnUiThread(Activity.java:4644)
08-02 12:11:57.299: I/dalvikvm(3599): at org.apache.cordova.CordovaActivity.showSplashScreen(CordovaActivity.java:1093)
08-02 12:11:57.299: I/dalvikvm(3599): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:370)
08-02 12:11:57.299: I/dalvikvm(3599): at com.bkam.Bkam.onCreate(Bkam.java:33)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.Activity.performCreate(Activity.java:5104)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-02 12:11:57.299: I/dalvikvm(3599): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 12:11:57.299: I/dalvikvm(3599): at android.os.Looper.loop(Looper.java:137)
08-02 12:11:57.299: I/dalvikvm(3599): at android.app.ActivityThread.main(ActivityThread.java:5039)
08-02 12:11:57.299: I/dalvikvm(3599): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 12:11:57.299: I/dalvikvm(3599): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 12:11:57.299: I/dalvikvm(3599): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-02 12:11:57.299: I/dalvikvm(3599): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-02 12:11:57.299: I/dalvikvm(3599): at dalvik.system.NativeStart.main(Native Method)
08-02 12:11:57.299: D/skia(3599): --- allocation failed for scaled bitmap
08-02 12:11:57.299: D/AndroidRuntime(3599): Shutting down VM
08-02 12:11:57.299: W/dalvikvm(3599): threadid=1: thread exiting with uncaught exception (group=0xb2d36908)
08-02 12:11:57.309: E/AndroidRuntime(3599): FATAL EXCEPTION: main
08-02 12:11:57.309: E/AndroidRuntime(3599): java.lang.OutOfMemoryError
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.content.res.Resources.loadDrawable(Resources.java:1965)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.content.res.Resources.getDrawable(Resources.java:660)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.view.View.setBackgroundResource(View.java:14463)
08-02 12:11:57.309: E/AndroidRuntime(3599): at org.apache.cordova.CordovaActivity$5.run(CordovaActivity.java:1070)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.Activity.runOnUiThread(Activity.java:4644)
08-02 12:11:57.309: E/AndroidRuntime(3599): at org.apache.cordova.CordovaActivity.showSplashScreen(CordovaActivity.java:1093)
08-02 12:11:57.309: E/AndroidRuntime(3599): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:370)
08-02 12:11:57.309: E/AndroidRuntime(3599): at com.bkam.Bkam.onCreate(Bkam.java:33)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.Activity.performCreate(Activity.java:5104)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.os.Looper.loop(Looper.java:137)
08-02 12:11:57.309: E/AndroidRuntime(3599): at android.app.ActivityThread.main(ActivityThread.java:5039)
08-02 12:11:57.309: E/AndroidRuntime(3599): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 12:11:57.309: E/AndroidRuntime(3599): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 12:11:57.309: E/AndroidRuntime(3599): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-02 12:11:57.309: E/AndroidRuntime(3599): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-02 12:11:57.309: E/AndroidRuntime(3599): at dalvik.system.NativeStart.main(Native Method)