Android - Sugar ORM数据库迁移多次运行

时间:2017-09-26 14:03:35

标签: android sugarorm

我有一个使用Sugar ORM构建的应用程序,现在有了应用程序更新,我需要更新架构。我遵循了Sugar ORM提供的有关数据库迁移的文档,它似乎在大多数时间都有效。但是,有时看起来升级会多次运行而导致崩溃。

根据文档我需要创建一个根据我的架构版本命名的SQL脚本,然后将其放入/assets/sugar-upgrades文件夹。这已经完成,这是我的简单脚本。

ALTER TABLE SETTINGS ADD VBTTN_ADDRESS TEXT;

正如您所看到的,我只是在SETTINGS表中添加一列。在此步骤之后,文档说要在AndroidManifest.xml file中设置新版本架构。这也已经完成。

从那里开始,更新过程应该在现有数据库中再次运行脚本,并且它正确地执行了此操作。但是,有时它似乎第二次运行脚本导致以下崩溃。

# Crashlytics - plaintext stacktrace downloaded by Paul Vinten at Fri, 22 Sep 2017 15:23:19 GMT
# URL: https://fabric.io/sl-labs/android/apps/com.myapp/issues/59bac986be077a4dcca10ad0?time=last-twenty-four-hours/sessions/59C512E5019C0001364FFFF2717BBDAC_a227484f9f9b11e7b44b56847afe9799_0_v2
# Organization: SL Labs
# Platform: android
# Application: Checkon.me
# Version: 1.4 (18)
# Bundle Identifier: com.myapp
# Issue #: 21
# Issue ID: 59bac986be077a4dcca10ad0
# Session ID: 59C512E5019C0001364FFFF2717BBDAC_a227484f9f9b11e7b44b56847afe9799_0_v2
# Date: 2017-09-22T13:40:44Z
# OS Version: 7.0
# Device: Galaxy S6
# RAM Free: 37.8%
# Disk Free: 85.4%

#0. Crashed: main: 0 0 0x0000000000000000
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

--

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.activities.MainActivity}: android.database.sqlite.SQLiteException: duplicate column name: VBTTN_ADDRESS (code 1): , while compiling: alter table SETTINGS add VBTTN_ADDRESS TEXT;
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
    (duplicate column name: VBTTN_ADDRESS (code 1): , while compiling: alter table SETTINGS add VBTTN_ADDRESS TEXT;)
#################################################################
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by android.database.sqlite.SQLiteException: duplicate column name: VBTTN_ADDRESS (code 1): , while compiling: alter table SETTINGS add VBTTN_ADDRESS TEXT;
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
    (duplicate column name: VBTTN_ADDRESS (code 1): , while compiling: alter table SETTINGS add VBTTN_ADDRESS TEXT;)
#################################################################
       at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java)
       at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1005)
       at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:570)
       at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
       at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
       at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
       at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:2055)
       at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1986)
       at com.orm.SchemaGenerator.executeScript(SchemaGenerator.java:97)
       at com.orm.SchemaGenerator.executeSugarUpgrade(SchemaGenerator.java:75)
       at com.orm.SchemaGenerator.doUpgrade(SchemaGenerator.java:52)
       at com.orm.SugarDb.onUpgrade(SugarDb.java:31)
       at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:256)
       at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
       at com.orm.SugarDb.getDB(SugarDb.java:36)
       at com.orm.SugarRecord.find(SugarRecord.java:189)
       at com.orm.SugarRecord.listAll(SugarRecord.java:94)
       at com.myapp.model.Settings.getSettings(Settings.java:71)
       at com.myapp.activities.MainActivity.onCreate(MainActivity.java:18)
       at android.app.Activity.performCreate(Activity.java:6942)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

#0. Crashed: main: 0 0 0x0000000000000000
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

#1. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#2. HeapTaskDaemon
       at dalvik.system.VMRuntime.runHeapTasks(VMRuntime.java)
       at java.lang.Daemons$HeapTaskDaemon.run(Daemons.java:433)
       at java.lang.Thread.run(Thread.java:762)

#3. OkHttp ConnectionPool
       at java.lang.Object.wait(Object.java)
       at com.android.okhttp.ConnectionPool.performCleanup(ConnectionPool.java:319)
       at com.android.okhttp.ConnectionPool.runCleanupUntilPoolIsEmpty(ConnectionPool.java:256)
       at com.android.okhttp.ConnectionPool.-wrap0(ConnectionPool.java)
       at com.android.okhttp.ConnectionPool$1.run(ConnectionPool.java:102)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#4. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#5. Crashlytics Report Uploader
       at java.lang.Thread.sleep(Thread.java)
       at java.lang.Thread.sleep(Thread.java:371)
       at java.lang.Thread.sleep(Thread.java:313)
       at com.crashlytics.android.core.ReportUploader$Worker.attemptUploadWithRetry(ReportUploader.java:188)
       at com.crashlytics.android.core.ReportUploader$Worker.onRun(ReportUploader.java:173)
       at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
       at java.lang.Thread.run(Thread.java:762)

#6. ReferenceQueueDaemon
       at java.lang.Object.wait(Object.java)
       at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:150)
       at java.lang.Thread.run(Thread.java:762)

#7. Answers Events Handler1
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1103)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1084)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
       at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
       at java.lang.Thread.run(Thread.java:762)

#8. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#9. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#10. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#11. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#12. Thread-11
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
       at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:438)
       at com.google.android.gms.common.zza.zza(Unknown Source)
       at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source)
       at com.google.android.gms.ads.identifier.AdvertisingIdClient.zzd(Unknown Source)
       at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
       at java.lang.reflect.Method.invoke(Method.java)
       at io.fabric.sdk.android.services.common.AdvertisingInfoReflectionStrategy.getInfo(AdvertisingInfoReflectionStrategy.java:106)
       at io.fabric.sdk.android.services.common.AdvertisingInfoReflectionStrategy.getAdvertisingId(AdvertisingInfoReflectionStrategy.java:76)
       at io.fabric.sdk.android.services.common.AdvertisingInfoReflectionStrategy.getAdvertisingInfo(AdvertisingInfoReflectionStrategy.java:66)
       at io.fabric.sdk.android.services.common.AdvertisingInfoProvider.getAdvertisingInfoFromStrategies(AdvertisingInfoProvider.java:118)
       at io.fabric.sdk.android.services.common.AdvertisingInfoProvider.access$000(AdvertisingInfoProvider.java:28)
       at io.fabric.sdk.android.services.common.AdvertisingInfoProvider$1.onRun(AdvertisingInfoProvider.java:70)
       at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
       at java.lang.Thread.run(Thread.java:762)

#13. FinalizerWatchdogDaemon
       at java.lang.Object.wait(Object.java)
       at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded(Daemons.java:269)
       at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:249)
       at java.lang.Thread.run(Thread.java:762)

#14. FinalizerDaemon
       at java.lang.Object.wait(Object.java)
       at java.lang.Object.wait(Object.java:407)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:204)
       at java.lang.Thread.run(Thread.java:762)

#15. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#16. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

#17. Crashlytics Exception Handler1
       at dalvik.system.VMStack.getThreadStackTrace(VMStack.java)
       at java.lang.Thread.getStackTrace(Thread.java:1567)
       at java.lang.Thread.getAllStackTraces(Thread.java:1617)
       at com.crashlytics.android.core.CrashlyticsController.writeSessionEvent(CrashlyticsController.java:1114)
       at com.crashlytics.android.core.CrashlyticsController.writeFatal(CrashlyticsController.java:852)
       at com.crashlytics.android.core.CrashlyticsController.access$400(CrashlyticsController.java:59)
       at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:292)
       at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:285)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
       at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
       at java.lang.Thread.run(Thread.java:762)

#18. Queue
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:2128)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:519)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:762)

有人有这个问题吗?有没有人想出如何解决这个问题?

**编辑** 此问题发生在发布版本上,而不是在开发中。它也是间歇性的。这不是我能够复制的东西。只有我的测试人员复制了它,除了在旧版本上安装新版本的应用程序之外,他们找不到其他模式。有时问题会发生,但大部分时间都没有。

1 个答案:

答案 0 :(得分:0)

增量构建应该存在问题。尝试使用干净的构建。

确保禁用Sugar ORM的即时运行

Crashlytics也增加了build-id以与时间戳同步。 您可以尝试通过将其添加到gradle文件来禁用它以进行开发环境。

android {
   ...
   buildTypes {
      debug {
        ext.enableCrashlytics = false
   }
}
祝你好运

埃姆雷