Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DiskReadViolation in Firebase Performance during Activity#onResume #7340

Open
@arkivanov

Description

  • Android Studio version: Build #IU-252.23892.409, built on August 1, 2025
  • Firebase Component: Performance
  • Component version: Firebase BOM 33.16.0

[REQUIRED] Step 3: Describe the problem

AppStartTrace produces strict mode DiskReadViolation through RemoteConfigComponent.

Steps to reproduce:

We observe the following error in our app:

13:27:55.677 D StrictMode policy violation; ~duration=27 ms: android.os.strictmode.DiskReadViolation
 	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1666)
 	at android.app.SharedPreferencesImpl.awaitLoadedLocked(SharedPreferencesImpl.java:275)
 	at android.app.SharedPreferencesImpl.getLong(SharedPreferencesImpl.java:328)
 	at com.google.firebase.remoteconfig.internal.ConfigSharedPrefsClient.getFetchTimeoutInSeconds(ConfigSharedPrefsClient.java:110)
 	at com.google.firebase.remoteconfig.RemoteConfigComponent.getFrcBackendApiClient(RemoteConfigComponent.java:264)
 	at com.google.firebase.remoteconfig.RemoteConfigComponent.getFetchHandler(RemoteConfigComponent.java:280)
 	at com.google.firebase.remoteconfig.RemoteConfigComponent.get(RemoteConfigComponent.java:190)
 	at com.google.firebase.perf.config.RemoteConfigManager.isFirebaseRemoteConfigAvailable(RemoteConfigManager.java:401)
 	at com.google.firebase.perf.config.RemoteConfigManager.triggerRemoteConfigFetchIfNecessary(RemoteConfigManager.java:337)
 	at com.google.firebase.perf.config.RemoteConfigManager.getRemoteConfigValue(RemoteConfigManager.java:301)
 	at com.google.firebase.perf.config.RemoteConfigManager.getBoolean(RemoteConfigManager.java:213)
 	at com.google.firebase.perf.config.ConfigResolver.getRemoteConfigBoolean(ConfigResolver.java:880)
 	at com.google.firebase.perf.config.ConfigResolver.getIsExperimentTTIDEnabled(ConfigResolver.java:839)
 	at com.google.firebase.perf.metrics.AppStartTrace.onActivityResumed(AppStartTrace.java:355)
 	at android.app.Application.dispatchActivityResumed(Application.java:431)
 	at android.app.Activity.dispatchActivityResumed(Activity.java:1483)
 	at android.app.Activity.onResume(Activity.java:2065)
 	at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:309)
 	at com.example.MainActivity.onResume(GrokActivity.kt:220)
 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1603)
 	at android.app.Activity.performResume(Activity.java:8743)
 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4952)
 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4995)
 	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
 	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
 	at android.os.Handler.dispatchMessage(Handler.java:106)
 	at android.os.Looper.loopOnce(Looper.java:205)
 	at android.os.Looper.loop(Looper.java:294)
 	at android.app.ActivityThread.main(ActivityThread.java:8177)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Relevant Code:

In your Application class add the following code:

import android.app.Application
import android.os.StrictMode
class MyApp : Application() {
 override fun onCreate() {
 StrictMode.setThreadPolicy(
 StrictMode.ThreadPolicy.Builder()
 .detectAll()
 .penaltyLog()
 .penaltyDeath()
 .build(),
 )
 StrictMode.setVmPolicy(
 StrictMode.VmPolicy.Builder()
 .detectAll()
 .penaltyLog()
 .penaltyDeath()
 .build()
 )
 super.onCreate()
 }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /