问题描述
我在项目中使用easeUI3.1.3,红米手机2(只有这个机型,其他ok)在聊天界面点击拍照->拍照界面确定之后crash掉,有的时候是进入聊天界面就crash掉。使用环信的Demo也有遇到这种情况,只不过环信的Demo是白屏之后重新加载了聊天界面,有的时候重建了一个聊天界面。怀疑是multiDexEnabled=true造成的,但是我把multiDexEnabled去掉还是一样。下面是出错时的日志:06-12 16:52:23.694 20760-20760/com.xjy.more D/x_log:ChatFragment$MyItemClickListener.onClick(L:935): 106-12 16:52:23.694 20760-20760/com.xjy.more D/x_log:ChatFragment.selectPicFromCamera(L:1104): 206-12 16:52:23.694 20760-20760/com.xjy.more D/x_log:ChatFragment.selectPicFromCamera(L:1105): /storage/emulated/0/Android/data/com.xjy.more/xjy#moretest/ca95b9ddb71d83201c6224eb6a6bbc19/file/ca95b9ddb71d83201c6224eb6a6bbc191465721543700.jpg06-12 16:52:23.694 20760-20760/com.xjy.more I/Timeline: Timeline: Activity_launch_request time:1095643906-12 16:52:24.584 20760-20760/com.xjy.more D/dalvikvm: GC_FOR_ALLOC freed 289K, 7% free 21701K/23152K, paused 59ms, total 60ms06-12 16:52:24.944 20760-20760/com.xjy.more W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection06-12 16:52:28.684 22393-22393/com.xjy.more D/ActivityThread: handleBindApplication:com.xjy.more06-12 16:52:28.684 22393-22393/com.xjy.more D/ActivityThread: setTargetHeapUtilization:0.7506-12 16:52:28.684 22393-22393/com.xjy.more D/ActivityThread: setTargetHeapMinFree:209715206-12 16:52:28.714 22393-22393/com.xjy.more I/MultiDex: VM with version 1.6.0 does not have multidex support06-12 16:52:28.714 22393-22393/com.xjy.more I/MultiDex: install06-12 16:52:28.724 22393-22393/com.xjy.more I/MultiDex: MultiDexExtractor.load(/data/app/com.xjy.more-2.apk, false)06-12 16:52:28.734 22393-22393/com.xjy.more I/MultiDex: loading existing secondary dex files06-12 16:52:28.734 22393-22393/com.xjy.more I/MultiDex: load found 1 secondary dex files06-12 16:52:28.734 22393-22393/com.xjy.more I/MultiDex: install done06-12 16:52:28.784 22393-22393/com.xjy.more D/EaseUI: process app name : com.xjy.more06-12 16:52:28.784 22393-22393/com.xjy.more D/dalvikvm: Trying to load lib /data/app-lib/com.xjy.more-2/libhyphenate.so 0x42780ea006-12 16:52:28.794 22393-22393/com.xjy.more D/dalvikvm: Added shared lib /data/app-lib/com.xjy.more-2/libhyphenate.so 0x42780ea006-12 16:52:28.804 22393-22414/com.xjy.more D/ONE SDK: [2016/6/12 16:52:28:812]: addConnectionListener06-12 16:52:28.804 22393-22414/com.xjy.more D/ONE SDK: [2016/6/12 16:52:28:813]: addConnectionListener06-12 16:52:28.814 22393-22414/com.xjy.more D/ONE SDK: [2016/6/12 16:52:28:818]: registerContactListener06-12 16:52:28.854 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.widget.ImageView.<init>, referenced from method com.facebook.drawee.view.DraweeView.<init>06-12 16:52:28.854 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve direct method 18085: Landroid/widget/ImageView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;II)V06-12 16:52:28.854 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x70 at 0x000006-12 16:52:28.854 22393-22393/com.xjy.more I/dalvikvm: Could not find method com.facebook.drawee.view.DraweeView.getImageTintList, referenced from method com.facebook.drawee.view.DraweeView.init06-12 16:52:28.854 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve virtual method 32461: Lcom/facebook/drawee/view/DraweeView;.getImageTintList ()Landroid/content/res/ColorStateList;06-12 16:52:28.854 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x6e at 0x001506-12 16:52:28.854 22393-22393/com.xjy.more I/AsyncTask: CPU : 406-12 16:52:28.864 22393-22393/com.xjy.more D/x_log:GlobalContext.onCreate(L:112): application recreate06-12 16:52:28.884 22393-22393/com.xjy.more D/dalvikvm: Trying to load lib /data/app-lib/com.xjy.more-2/libffmpeg.so 0x42780ea006-12 16:52:28.884 22393-22393/com.xjy.more W/linker: libffmpeg.so has text relocations. This is wasting memory and is a security risk. Please fix.06-12 16:52:28.904 22393-22393/com.xjy.more D/dalvikvm: Added shared lib /data/app-lib/com.xjy.more-2/libffmpeg.so 0x42780ea006-12 16:52:28.904 22393-22393/com.xjy.more D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.xjy.more-2/libffmpeg.so 0x42780ea0, skipping init06-12 16:52:28.914 22393-22393/com.xjy.more D/dalvikvm: Trying to load lib /data/app-lib/com.xjy.more-2/libopenh264.so 0x42780ea006-12 16:52:28.914 22393-22393/com.xjy.more D/dalvikvm: Added shared lib /data/app-lib/com.xjy.more-2/libopenh264.so 0x42780ea006-12 16:52:28.914 22393-22393/com.xjy.more D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.xjy.more-2/libopenh264.so 0x42780ea0, skipping init06-12 16:52:28.914 22393-22393/com.xjy.more D/dalvikvm: Trying to load lib /data/app-lib/com.xjy.more-2/libvcamera.so 0x42780ea006-12 16:52:28.924 22393-22393/com.xjy.more D/dalvikvm: Added shared lib /data/app-lib/com.xjy.more-2/libvcamera.so 0x42780ea006-12 16:52:28.944 22393-22419/com.xjy.more D/x_log:Utility.buildUrl(L:79): size=middle&version=726&account_id=117×tamp=1465721548&random_key=de18b6b00a8ce88b8999c7465cb4c59706-12 16:52:28.944 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)06-12 16:52:28.944 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested06-12 16:52:28.944 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve interface method 17419: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z06-12 16:52:28.944 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x72 at 0x000206-12 16:52:28.944 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode06-12 16:52:28.944 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve interface method 17423: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;06-12 16:52:28.944 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x72 at 0x000206-12 16:52:28.954 22393-22393/com.xjy.more D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getTotalMemory ()J06-12 16:52:28.954 22393-22393/com.xjy.more D/dalvikvm: GetMethodID: not returning static method Landroid/os/Process;.getFreeMemory ()J06-12 16:52:28.974 22393-22393/com.xjy.more D/x_log:ChatFragment.onCreate(L:162): created06-12 16:52:28.974 22393-22426/com.xjy.more D/com.umeng.message.MessageSharedPrefs: Constructor()06-12 16:52:28.994 22393-22393/com.xjy.more D/com.umeng.message.MsgLogStore: appLaunchAt=146569935764406-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getComment not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setComment not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getCommentURL not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setCommentURL not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getValue not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setValue not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getDomain not exist06-12 16:52:29.004 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setDomain not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getPortList not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setPortList not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getName not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setName not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getPath not exist06-12 16:52:29.014 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setPath not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getExpiry not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setExpiry not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findBooleanGetMethod(L:129): org.xutils.http.cookie.CookieEntity#isSecure not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getSecure not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findBooleanSetMethod(L:144): org.xutils.http.cookie.CookieEntity#setSecure not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setSecure not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findBooleanGetMethod(L:129): org.xutils.http.cookie.CookieEntity#isDiscard not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getDiscard not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findBooleanSetMethod(L:144): org.xutils.http.cookie.CookieEntity#setDiscard not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setDiscard not exist06-12 16:52:29.024 22393-22419/com.xjy.more D/x_log:ColumnUtils.findGetMethod(L:84): org.xutils.http.cookie.CookieEntity#getVersion not exist06-12 16:52:29.034 22393-22419/com.xjy.more D/x_log:ColumnUtils.findSetMethod(L:109): org.xutils.http.cookie.CookieEntity#setVersion not exist06-12 16:52:29.034 22393-22426/com.xjy.more D/miuisdk: current sdk level is 606-12 16:52:29.044 22393-22419/com.xjy.more D/x_log:HttpTask.doBackground(L:303): load: https://tapi.tongmowang.com/in ... aunch06-12 16:52:29.114 22393-22393/com.xjy.more D/dalvikvm: GC_FOR_ALLOC freed 1540K, 12% free 14595K/16400K, paused 25ms, total 25ms06-12 16:52:29.124 22393-22393/com.xjy.more D/com.umeng.message.UTrack: sendCachedMsgLog start, set cacheLogSending flag06-12 16:52:29.124 22393-22393/com.xjy.more D/com.umeng.message.UTrack: sendCachedMsgLog(delay=0)06-12 16:52:29.134 22393-22438/com.xjy.more D/com.umeng.message.UTrack: sendCachedMsgLog finished, clear cacheLogSending flag06-12 16:52:29.154 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations06-12 16:52:29.154 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve virtual method 683: Landroid/content/res/TypedArray;.getChangingConfigurations ()I06-12 16:52:29.154 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x6e at 0x000206-12 16:52:29.154 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType06-12 16:52:29.154 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve virtual method 705: Landroid/content/res/TypedArray;.getType (I)I06-12 16:52:29.154 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x6e at 0x000206-12 16:52:29.174 22393-22393/com.xjy.more D/x_log:ChatActivity.onCreate(L:31): activity created06-12 16:52:29.194 22393-22419/com.xjy.more D/x_log:BaseDao.sendSync(L:71): {"status":{"code":1000,"msg":"u6210u529f"},"data":{"version":"726","list":[null]}}06-12 16:52:29.254 22393-22393/com.xjy.more D/dalvikvm: GC_FOR_ALLOC freed 571K, 9% free 15496K/16880K, paused 17ms, total 17ms06-12 16:52:29.304 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable06-12 16:52:29.304 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve virtual method 646: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;06-12 16:52:29.304 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x6e at 0x000206-12 16:52:29.304 22393-22393/com.xjy.more I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity06-12 16:52:29.304 22393-22393/com.xjy.more W/dalvikvm: VFY: unable to resolve virtual method 648: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;06-12 16:52:29.304 22393-22393/com.xjy.more D/dalvikvm: VFY: replacing opcode 0x6e at 0x000206-12 16:52:29.364 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.364 22393-22393/com.xjy.more I/hyphenate_jni: nativeMarkAllMessagesAsRead06-12 16:52:29.364 22393-22393/com.xjy.more I/hyphenate_jni: nativeLoadMoreMessages06-12 16:52:29.364 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.364 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.364 22393-22393/com.xjy.more D/x_log:ChatFragment.onCreate(L:162): created06-12 16:52:29.374 22393-22419/com.xjy.more D/x_log:FlashUrlTask.run(L:34): lastFlashUrlVerison-->72606-12 16:52:29.404 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.404 22393-22393/com.xjy.more I/hyphenate_jni: nativeMarkAllMessagesAsRead06-12 16:52:29.404 22393-22393/com.xjy.more I/hyphenate_jni: nativeLoadMoreMessages06-12 16:52:29.404 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.404 22393-22393/com.xjy.more D/EMChatManager: convID:f1688418cda0528a4bc418883772228506-12 16:52:29.404 22393-22393/com.xjy.more D/x_log:ChatFragment.onActivityResult(L:460): 306-12 16:52:29.404 22393-22393/com.xjy.more D/x_log:ChatFragment.onActivityResult(L:461): -106-12 16:52:29.404 22393-22393/com.xjy.more D/x_log:ChatFragment.onActivityResult(L:462): requestCode 206-12 16:52:29.404 22393-22393/com.xjy.more D/x_log:ChatFragment.onActivityResult(L:465): 406-12 16:52:29.404 22393-22393/com.xjy.more D/x_log:ChatFragment.onActivityResult(L:466): true
解决方案
demo的拍照是调用的系统的,你自己实现拍照看看
解决方案二:
问题的原因已经定位:由于红米内存小,开启拍照界面后会杀死应用。