本文介绍了每个活动开始后显示SQLiteConstraintException错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我总是在logcat中弹出此错误.它总是在每次活动更改后显示.有时,该应用程序消失了,一秒钟后又再次显示.logcat中没有任何致命错误,我所看到的是:
I have this error popping out in logcat all the time. It always shows after every change of activity. And sometimes, the app disappears and in a second it shows again. There is not any fatal error in logcat, all I see is this:
2020-05-20 11:53:26.422 2940-8484/? E/SQLiteDatabase: Error inserting flex_time=3324000 job_id=-1 period=6650000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=201516000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1589968406417 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1599)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1468)
at aplm.a(:com.google.android.gms@201516038@20.15.16 (120406-309763488):76)
at aplb.a(:com.google.android.gms@201516038@20.15.16 (120406-309763488):173)
at aplb.a(:com.google.android.gms@201516038@20.15.16 (120406-309763488):21)
at aplb.a(:com.google.android.gms@201516038@20.15.16 (120406-309763488):167)
at aphk.run(:com.google.android.gms@201516038@20.15.16 (120406-309763488):8)
at sob.b(:com.google.android.gms@201516038@20.15.16 (120406-309763488):12)
at sob.run(:com.google.android.gms@201516038@20.15.16 (120406-309763488):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at sub.run(:com.google.android.gms@201516038@20.15.16 (120406-309763488):0)
at java.lang.Thread.run(Thread.java:919)
但是它没有显示代码的任何地方吗?
But it does not show anywhere to the code is there any solution to it?
Google图书馆:
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.firebase:firebase-core:17.1.0'
implementation 'com.google.firebase:firebase-database:19.0.0'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'com.google.firebase:firebase-perf:19.0.0'
implementation 'com.google.android.gms:play-services-ads:18.1.1'
推荐答案
来自此问题在 firebase-android-sdk
项目中打开:
这篇关于每个活动开始后显示SQLiteConstraintException错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!