目录
1、查看日志
2、分析日志、提取重点
3、寻找解决方法
author | daisy.skye的博客_CSDN博客-嵌入式,Qt,Linux领域博主 daisy.skye_嵌入式,Linux,Qt-CSDN博客daisy.skye擅长嵌入式,Linux,Qt,等方面的知识https://blog.csdn.net/qq_40715266?type=blog |
1、查看日志
这次碰到在安卓7系统上使用自带的原生相机,从拍照切换到视频时出现崩溃,崩溃日志如下
12-14 10:03:42.489 432 2337 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
12-14 10:03:42.514 572 5555 E mm-camera: <MCT ><ERROR> 1085: mct_pipeline_decide_hw_wakeup: Couldn't find meta stream
12-14 10:03:42.521 572 5598 E quadracfa_dummy: inside dummy remosaic_deinit 1
12-14 10:03:42.547 5483 5483 E AndroidRuntime: FATAL EXCEPTION: main
12-14 10:03:42.547 5483 5483 E AndroidRuntime: Process: com.android.camera2, PID: 5483
12-14 10:03:42.547 5483 5483 E AndroidRuntime: android.content.res.Resources$NotFoundException: Drawable com.android.camera2:drawable/ic_capture_video with resource ID #0x7f020050
12-14 10:03:42.547 5483 5483 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_capture_video.xml from drawable resource ID #0x7f020050
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:725)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:571)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:771)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:742)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.ui.BottomBar.setShutterButtonIcon(BottomBar.java:493)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.app.CameraAppUI.setBottomBarShutterIcon(CameraAppUI.java:1880)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.app.CameraAppUI.resetBottomControls(CameraAppUI.java:1821)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.CameraActivity.onModeSelected(CameraActivity.java:2456)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.app.CameraAppUI.onModeSelected(CameraAppUI.java:1560)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.ui.ModeListView.onModeSelected(ModeListView.java:1266)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.ui.ModeListView.-wrap13(ModeListView.java)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.camera.ui.ModeListView$PeepholeAnimationEffect$8$1.run(ModeListView.java:2158)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6187)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #25: <bitmap> requires a valid 'src' attribute
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.BitmapDrawable.updateStateFromTypedArray(BitmapDrawable.java:787)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:747)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.StateListDrawable.inflateChildElements(StateListDrawable.java:188)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:116)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1200)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:715)
12-14 10:03:42.547 5483 5483 E AndroidRuntime: ... 18 more
12-14 10:03:42.914 1184 1368 E libnav : CablComputeBacklightLevel(): UpdateType = DifferentSceneUpdate
12-14 10:03:43.057 432 2337 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
12-14 10:03:43.249 1609 2060 E LocSvc_eng: E/Calling gnss_sv_status_cb
12-14 10:03:43.250 1609 2060 E IzatSvc_PassiveLocListener: E/Exiting with error virtual void izat_manager::IzatPassiveLocationListener::onLocationChanged(const izat_manager::IzatLocation *, const IzatLocationStatus) line 172 "1"
2、分析日志、提取重点
其中造成崩溃的原因主要是如下内容,实际过程中日志更多,需要能提取有效日志进行分析
12-14 10:03:42.547 5483 5483 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_capture_video.xml from drawable resource ID #0x7f020050
12-14 10:03:42.547 5483 5483 E AndroidRuntime: E AndroidRuntime:
3、寻找解决方法
其实很多原生系统引起的问题,并不是个例,属于历史遗留的潜在bug,不过毕竟是开源,所以很多开发者也会将问题和解决方案在github社区进行提交并解决,本次解决方法,就是在github上查询code发现已经有社区工作者发现了问题并提交了的代码。需要善于利用现有的工具和搜索方法帮助自己找到答案。
Camera2: Bitmaps renamed due crash when switching to Video Capture mo… by rINanDO · Pull Request #6 · CyanogenMod/android_packages_apps_Camera2 · GitHub文章来源:https://www.toymoban.com/news/detail-851013.html
文章来源地址https://www.toymoban.com/news/detail-851013.html
<item>
<bitmap
android:gravity="center"
android:src="@drawable/ic_capture_video" />
android:src="@drawable/ic_capture_video_enabled" />
</item>
</selector>
到了这里,关于安卓7原生相机切到视频崩溃的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!