gpt4 book ai didi

android - 如何找出针对 Strictmode 策略违规采取的措施

转载 作者:行者123 更新时间:2023-11-29 21:03:12 28 4
gpt4 key购买 nike

我是 android 的新手,正在调试现有的应用程序。当应用程序运行时,我遇到了 StrictMode 策略违规。我想了解违规发生后采取了哪些措施?我正在粘贴日志。

D/StrictMode( 4548): StrictMode policy violation; ~duration=68 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=31 violation=2
D/StrictMode( 4548): at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1135)
D/StrictMode( 4548): at libcore.io.BlockGuardOs.read(BlockGuardOs.java:148)
D/StrictMode( 4548): at libcore.io.IoBridge.read(IoBridge.java:425)
D/StrictMode( 4548): at java.io.RandomAccessFile.read(RandomAccessFile.java:287)
D/StrictMode( 4548): at java.io.RandomAccessFile.read(RandomAccessFile.java:270)
D/StrictMode( 4548): at com.intel.android.gallery3d.common.BlobCache.loadIndex(BlobCache.java:260)
D/StrictMode( 4548): at com.intel.android.gallery3d.common.BlobCache.<init>(BlobCache.java:144)
D/StrictMode( 4548): at com.intel.android.gallery3d.util.CacheManager.getCache(CacheManager.java:56)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.Bookmarker.getBookmark(Bookmarker.java:64)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MoviePlayer.initPlayer(MoviePlayer.java:281)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MoviePlayer.<init>(MoviePlayer.java:142)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MovieActivity$1.<init>(MovieActivity.java:91)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MovieActivity.onCreate(MovieActivity.java:90)
D/StrictMode( 4548): at android.app.Activity.performCreate(Activity.java:5231)
D/StrictMode( 4548): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
D/StrictMode( 4548): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2188)
D/StrictMode( 4548): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273)
D/StrictMode( 4548): at android.app.ActivityThread.access$800(ActivityThread.java:138)
D/StrictMode( 4548): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
D/StrictMode( 4548): at android.os.Handler.dispatchMessage(Handler.java:102)
D/StrictMode( 4548): at android.os.Looper.loop(Looper.java:149)
D/StrictMode( 4548): at android.app.ActivityThread.main(ActivityThread.java:5045)
D/StrictMode( 4548): at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode( 4548): at java.lang.reflect.Method.invoke(Method.java:515)
D/StrictMode( 4548): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
D/StrictMode( 4548): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
D/StrictMode( 4548): at dalvik.system.NativeStart.main(Native Method)
D/StrictMode( 4548): StrictMode policy violation; ~duration=67 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=31 violation=1
D/StrictMode( 4548): at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1109)
D/StrictMode( 4548): at libcore.io.BlockGuardOs.ftruncate(BlockGuardOs.java:101)
D/StrictMode( 4548): at java.io.RandomAccessFile.setLength(RandomAccessFile.java:626)
D/StrictMode( 4548): at com.intel.android.gallery3d.common.BlobCache.setActiveVariables(BlobCache.java:286)
D/StrictMode( 4548): at com.intel.android.gallery3d.common.BlobCache.loadIndex(BlobCache.java:275)
D/StrictMode( 4548): at com.intel.android.gallery3d.common.BlobCache.<init>(BlobCache.java:144)
D/StrictMode( 4548): at com.intel.android.gallery3d.util.CacheManager.getCache(CacheManager.java:56)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.Bookmarker.getBookmark(Bookmarker.java:64)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MoviePlayer.initPlayer(MoviePlayer.java:281)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MoviePlayer.<init>(MoviePlayer.java:142)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MovieActivity$1.<init>(MovieActivity.java:91)
D/StrictMode( 4548): at com.intel.android.gallery3d.app.MovieActivity.onCreate(MovieActivity.java:90)
D/StrictMode( 4548): at android.app.Activity.performCreate(Activity.java:5231)
D/StrictMode( 4548): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
D/StrictMode( 4548): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2188)
D/StrictMode( 4548): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273)
D/StrictMode( 4548): at android.app.ActivityThread.access$800(ActivityThread.java:138)
D/StrictMode( 4548): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
D/StrictMode( 4548): at android.os.Handler.dispatchMessage(Handler.java:102)
D/StrictMode( 4548): at android.os.Looper.loop(Looper.java:149)
D/StrictMode( 4548): at android.app.ActivityThread.main(ActivityThread.java:5045)
D/StrictMode( 4548): at java.lang.reflect.Method.invokeNative(Native Method)
D/StrictMode( 4548): at java.lang.reflect.Method.invoke(Method.java:515)
D/StrictMode( 4548): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
D/StrictMode( 4548): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
D/StrictMode( 4548): at dalvik.system.NativeStart.main(Native Method)

感谢任何帮助。

最佳答案

转到设备设置 -> 开发人员选项并启用严格模式。每当您的应用违反任何一项严格模式政策时,启用此选项将使屏幕闪烁红色。以便您了解。

关于android - 如何找出针对 Strictmode 策略违规采取的措施,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25374121/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com