Beagle crashing getBeagleCacheFromDisk function with unchecked cache

Asked

Viewed 27 times

4

I’m using Beagle 1.4 (usebeagle.io) in a partially server driven Android app. I have the cache disabled in Beagleconfig, but when I get to the screen with the Beagle UI, the app crashes. I do not know if it is possible to enable the cache otherwise, and I have no way to ask all the developers of the app. If it is possible to enable in other ways, I need to know all of them to disable them.

@BeagleComponent
class AppBeagleConfig : BeagleConfig {
    override val isLoggingEnabled: Boolean = ServerDrivenConfig.data.isDebug
    override val baseUrl: String = ServerDrivenConfig.data.baseUrl
    override val environment: Environment = ServerDrivenConfig.data.environment
    override val cache: Cache = Cache(
        enabled = false,
        maxAge = 300
    )
}
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1
    Process: com.example, PID: 0000
    java.lang.NullPointerException
        at br.com.zup.beagle.android.cache.CacheManager.getBeagleCacheFromDisk(CacheManager.kt:89)
        at br.com.zup.beagle.android.cache.CacheManager.restoreCacheFromDisk(CacheManager.kt:69)
        at br.com.zup.beagle.android.cache.CacheManager.restoreBeagleCacheForUrl(CacheManager.kt:60)
        at br.com.zup.beagle.android.data.ComponentRequester.fetchComponent(ComponentRequester.kt:36)
        at br.com.zup.beagle.android.view.viewmodel.BeagleViewModel$FetchComponentLiveData$fetchComponents$1.invokeSuspend(BeagleViewModel.kt:84)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
  • 1

    doubt answered here: https://answall.com/questions/480901/problema-no-cache-do-beagle-1-4/480902#480902

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.