如何使用Firebase修复严格模式磁盘读取冲突

时间:2018-12-11 00:28:38

标签: android firebase firebase-remote-config firebase-performance

我收到了来自Firebase 16+的StrictMode违规。可能在RemoteConfig API中。在不关闭StrictMode的情况下解决此问题的任何方法?

Caused by: android.os.strictmode.DiskReadViolation
        at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1504)
        at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
        at java.io.File.exists(File.java:815)
        at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:605)
        at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:596)
        at android.app.ContextImpl.getFilesDir(ContextImpl.java:641)
        at android.app.ContextImpl.openFileInput(ContextImpl.java:559)
        at android.content.ContextWrapper.openFileInput(ContextWrapper.java:202)
        at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zze(Unknown Source:63)
        at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zzc(Unknown Source:20)
        at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source:13)
        at com.google.firebase.perf.internal.RemoteConfigManager.<init>(Unknown Source:2)
        at com.google.firebase.perf.internal.RemoteConfigManager.<clinit>(Unknown Source:160)
        at com.google.firebase.perf.internal.RemoteConfigManager.zzcb(Unknown Source:17)
        at com.google.firebase.perf.internal.FeatureControl.<init>(Unknown Source:2)
        at com.google.firebase.perf.internal.FeatureControl.zzar(Unknown Source:10)
        at com.google.firebase.perf.internal.GaugeManager.<init>(Unknown Source:4)
        at com.google.firebase.perf.internal.GaugeManager.zzbf(Unknown Source:22)
        at com.google.firebase.perf.internal.SessionManager.<init>(Unknown Source:4)
        at com.google.firebase.perf.internal.SessionManager.<clinit>(Unknown Source:45)
        at com.google.firebase.perf.internal.SessionManager.zzcn(Unknown Source:1)
        at com.google.firebase.perf.metrics.AppStartTrace.onActivityCreated(Unknown Source:37)
        at android.app.Application.dispatchActivityCreated(Application.java:220)
        at android.app.Activity.onCreate(Activity.java:1048)
        at android.support.v4.app.SupportActivity.onCreate(SupportActivity.java:66)
        at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:321)

0 个答案:

没有答案