Сбой Firebase: CorruptionException в предпочтениях, чтобы получить хранилище данных, но не используя прото -хранилище илAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Сбой Firebase: CorruptionException в предпочтениях, чтобы получить хранилище данных, но не используя прото -хранилище ил

Сообщение Anonymous »

Я сталкиваюсь с аварии в Firebase Crashlytics на определенных устройствах, связанных с Androidx.datastore.core.corruptionException: невозможно проанализировать предпочтения Proto. Тем не менее, я не использую Proto Datastore в своем приложении. Сбой появляется в Android 12,13 и 14, 100% на фоновых устройствах. Ниже приведен трассировка стека: < /p>

Код: Выделить всё

Fatal Exception: androidx.datastore.core.CorruptionException: Unable to parse preferences proto.
at androidx.datastore.preferences.PreferencesMapCompat$Companion.readFrom(PreferencesMapCompat.kt:20)
at androidx.datastore.preferences.core.PreferencesSerializer.readFrom(PreferencesSerializer.jvm.kt:7)
at androidx.datastore.core.okio.OkioReadScope.readData$suspendImpl(OkioStorage.kt:86)
at androidx.datastore.core.okio.OkioReadScope.readData(OkioStorage.kt)
...

Caused by androidx.datastore.preferences.protobuf.InvalidProtocolBufferException:  Protocol message contained an invalid tag (zero).
at androidx.datastore.preferences.protobuf.CodedInputStream$StreamDecoder.readTag(CodedInputStream.java:25)
at androidx.datastore.preferences.protobuf.CodedInputStreamReader.getFieldNumber(CodedInputStreamReader.java:12)
at androidx.datastore.preferences.protobuf.MessageSchema.mergeFromHelper(MessageSchema.java:15)
at androidx.datastore.preferences.protobuf.MessageSchema.mergeFrom(MessageSchema.java:1)
at androidx.datastore.preferences.protobuf.GeneratedMessageLite.parsePartialFrom(GeneratedMessageLite.java:3)
at androidx.datastore.preferences.protobuf.GeneratedMessageLite.parseFrom(GeneratedMessageLite.java:5)
at androidx.datastore.preferences.PreferencesProto$PreferenceMap.parseFrom(PreferencesProto.java:5)
at androidx.datastore.preferences.PreferencesMapCompat$Companion.readFrom(PreferencesMapCompat.kt:5)
at androidx.datastore.preferences.core.PreferencesSerializer.readFrom(PreferencesSerializer.jvm.kt:7)
at androidx.datastore.core.okio.OkioReadScope.readData$suspendImpl(OkioStorage.kt:86)
at androidx.datastore.core.okio.OkioReadScope.readData(OkioStorage.kt)
at androidx.datastore.core.StorageConnectionKt$readData$2.invokeSuspend(StorageConnection.kt:32)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:1)
at androidx.datastore.core.StorageConnectionKt$readData$2.invoke(StorageConnection.kt:2)
at androidx.datastore.core.okio.OkioStorageConnection.readScope(OkioStorage.kt:97)
at androidx.datastore.core.StorageConnectionKt.readData(StorageConnection.kt:6)
at androidx.datastore.core.DataStoreImpl.readDataFromFileOrDefault(DataStoreImpl.kt:4)
at androidx.datastore.core.DataStoreImpl.readDataOrHandleCorruption(DataStoreImpl.kt:159)
at androidx.datastore.core.DataStoreImpl.access$readDataOrHandleCorruption(DataStoreImpl.kt)
at androidx.datastore.core.DataStoreImpl$InitDataStore$doRun$initData$1.invokeSuspend(DataStoreImpl.kt:129)
at androidx.datastore.core.DataStoreImpl$InitDataStore$doRun$initData$1.invoke(DataStoreImpl.kt:2)
at androidx.datastore.core.DataStoreImpl$InitDataStore$doRun$initData$1.invoke(DataStoreImpl.kt:1)
at androidx.datastore.core.SingleProcessCoordinator.lock(SingleProcessCoordinator.kt:97)
at androidx.datastore.core.DataStoreImpl$InitDataStore.doRun(DataStoreImpl.kt:91)
at androidx.datastore.core.RunOnce.runIfNeeded(DataStoreImpl.kt:130)
at androidx.datastore.core.DataStoreImpl.readAndInitOrPropagateAndThrowFailure(DataStoreImpl.kt:101)
at androidx.datastore.core.DataStoreImpl.handleUpdate(DataStoreImpl.kt:156)
at androidx.datastore.core.DataStoreImpl.access$handleUpdate(DataStoreImpl.kt)
at androidx.datastore.core.DataStoreImpl$writeActor$3.invokeSuspend(DataStoreImpl.kt:34)
at androidx.datastore.core.DataStoreImpl$writeActor$3.invoke(DataStoreImpl.kt:1)
at androidx.datastore.core.DataStoreImpl$writeActor$3.invoke(DataStoreImpl.kt:2)
at androidx.datastore.core.SimpleActor$offer$2.invokeSuspend(SimpleActor.kt:86)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:11)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:3)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:2)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:14)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:28)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)

Я просмотрел свой код и не могу найти, где прото -хранилище используется или общая миграция префенерсенса, поэтому я не уверен, что может вызвать этот аварий.

Код: Выделить всё

plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'kotlin-android'
id 'com.google.devtools.ksp'
id 'com.google.firebase.firebase-perf'
id 'kotlin-parcelize'
id 'org.jetbrains.kotlin.android'
id("org.jetbrains.kotlin.plugin.compose") version "$kotlin_version"

}

buildFeatures {
viewBinding true
compose true
buildConfig = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "17"
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.browser:browser:1.8.0'
implementation 'com.google.firebase:firebase-perf-ktx:21.0.1'
implementation 'com.google.firebase:firebase-config-ktx:22.0.0'
implementation project(path:  ':library_lvl')
implementation 'androidx.core:core-ktx:1.13.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'

implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// Media 3 instead of Exoplayer
implementation 'androidx.media3:media3-exoplayer:1.4.1'
implementation "androidx.media3:media3-ui:1.4.1"

// Import the BoM for the Firebase platform
implementation 'com.google.firebase:firebase-crashlytics-ktx:19.1.0'
implementation 'com.google.firebase:firebase-analytics-ktx:22.1.0'

implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.6'
implementation 'com.anggrayudi:storage:2.0.0'
//implementation 'com.github.skydoves:powerspinner:1.2.4'         // custom spinner
freeImplementation 'com.google.android.gms:play-services-ads:23.3.0' // it was 20.3.0
implementation 'com.github.judemanutd:autostarter:1.1.0'    // auto start for some devices

// for app open ads
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.6'
implementation 'androidx.lifecycle:lifecycle-process:2.8.6'

// room
def room_version = "2.6.1"
implementation "androidx.room:room-runtime:$room_version"
ksp "androidx.room:room-compiler:$room_version"
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"

/** compose **/
// Integration with activities
implementation 'androidx.activity:activity-compose:1.9.2'
implementation 'androidx.activity:activity-ktx:1.9.2'
// Compose Material Design
implementation 'androidx.compose.material:material:1.7.2'
// Animations
implementation 'androidx.compose.animation:animation:1.7.2'
// Tooling support (Previews,  etc.)
implementation 'androidx.compose.ui:ui-tooling:1.7.2'
// Integration with ViewModels
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6'
// When using a AppCompat theme
implementation 'androidx.compose.runtime:runtime-livedata:1.7.2'
/*
View model
*/
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.6'

/** Jetpack data store */
implementation "androidx.datastore:datastore-preferences:1.1.1"

// compose navigation ..
implementation "androidx.navigation:navigation-compose:2.8.1"
implementation 'androidx.compose.material3:material3:1.3.0'
// compose permission ..
implementation 'com.google.accompanist:accompanist-permissions:0.36.0'
// optional - helpers for implementing LifecycleOwner in a Service
implementation 'androidx.lifecycle:lifecycle-service:2.8.6'

// Saved state module for ViewModel
implementation('androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.6')

// In app update ..
implementation 'com.google.android.play:app-update:2.1.0'

// For Kotlin users also add the Kotlin extensions library for Play In-App Update:
implementation 'com.google.android.play:app-update-ktx:2.1.0'

// to show drawable NOT FROM Resources in compfose
implementation 'com.google.accompanist:accompanist-drawablepainter:0.36.0'

// permission flow
implementation 'dev.shreyaspatil.permission-flow:permission-flow-compose:2.0.0'

// coil
implementation('io.coil-kt:coil-compose:2.7.0')
implementation('io.coil-kt:coil-video:2.7.0')   // for video thumbnail

// for collect with life cycle
implementation 'androidx.lifecycle:lifecycle-runtime-compose:2.8.6'

//  implementation 'com.github.tejpratap46:PDFCreatorAndroid:3.0.2'  // pdf generation
implementation 'androidx.core:core-splashscreen:1.0.1'  // splash screen
// color picker dialog
implementation 'com.godaddy.android.colorpicker:compose-color-picker-android:0.7.0'
implementation 'androidx.paging:paging-compose:3.3.2'   // paging library
implementation("com.google.android.play:review-ktx:2.0.1")  // in app review
implementation 'androidx.compose.ui:ui-util:1.7.2'     // for fast collections functions
implementation 'androidx.compose.ui:ui:1.7.2'

// https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j
implementation 'net.lingala.zip4j:zip4j:2.11.5'

freeImplementation project(path: ':subscription')

implementation 'com.partners.analytics.core.coverage:sdk-init:3.5.10'
implementation 'com.github.SmartToolFactory:Compose-Extended-Gestures:3.1'  // motion modifiers

// koin dependency injection
def koinVersion = "4.0.0"
implementation("io.insert-koin:koin-android:$koinVersion")
implementation("io.insert-koin:koin-androidx-compose:$koinVersion")
implementation("io.insert-koin:koin-androidx-workmanager:$koinVersion")
implementation ("io.insert-koin:koin-core-coroutines:$koinVersion")

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.2' // use date time before 26
implementation 'androidx.biometric:biometric:1.2.0-alpha05' // biometric lock

implementation('com.airbnb.android:lottie-compose:6.5.2')   //lottie

}

Правила прогноза:
-keep class androidx.datastore.** { *; }
-keep class kotlinx.coroutines.** { *; }
-keep class kotlin.** { *; }
< /code>
Шаги, которые я предпринял: < /strong>
Обзор кода: я не ссылаюсь на дату данных Proto в моем коде, ни миграция Firebase.
Затронутые библиотеки: сбоя ссылаются на предпочтения, что, кажется, связано с предпочтениями. Есть ли шанс, что это может быть вызвано сторонней библиотекой или чем-то, что касается затронутых устройств?
Должен ли я добавить обработчик коррупции ко всем хранилищам данных моего приложения, особенно в том, что у каждой функции есть своя? < /P>

Подробнее здесь: https://stackoverflow.com/questions/790 ... tore-but-n
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»