Flutter Firebase应用程序在发行版本中崩溃,但在调试时运行良好

时间:2019-12-21 15:19:53

标签: firebase flutter google-cloud-firestore

当我从Play商店安装我的应用程序的Beta版本时,启动屏幕后崩溃。当我在android studio中检查logcat时,发现以下异常:

2019-12-21 16:05:13.603 21888-21993/? E/e.b.b.D: Creating atomic field updaters failed
java.lang.RuntimeException: java.security.PrivilegedActionException: java.lang.NoSuchFieldException: No field streamClosed in class Le/b/b/D$c; (declaration of 'e.b.b.D$c' appears in /data/app/com.wallmann.project_fit_flutter-ow2qlZAyLY4PRx1wLHclMw==/base.apk)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:409)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:87)
    at e.b.b.D.<clinit>(:79)
    at e.b.b.c.d(:436)
    at e.b.b.c.b(:411)
    at e.b.a.d.b(:176)
    at com.google.firebase.firestore.f.p.<init>(:131)
    at com.google.firebase.firestore.b.z.a(:245)
    at com.google.firebase.firestore.b.z.a(:116)
    at com.google.firebase.firestore.b.u.run(Unknown Source:8)
    at com.google.firebase.firestore.g.j.a(:311)
    at com.google.firebase.firestore.g.f.call(Unknown Source:2)
    at com.google.firebase.firestore.g.j.a(:287)
    at com.google.firebase.firestore.g.e.run(Unknown Source:4)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at com.google.firebase.firestore.g.j$a.run(:205)
    at java.lang.Thread.run(Thread.java:764)
 Caused by: java.security.PrivilegedActionException: java.lang.NoSuchFieldException: No field streamClosed in class Le/b/b/D$c; (declaration of 'e.b.b.D$c' appears in /data/app/com.wallmann.project_fit_flutter-ow2qlZAyLY4PRx1wLHclMw==/base.apk)
    at java.security.AccessController.doPrivileged(AccessController.java:71)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:387)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:87) 
    at e.b.b.D.<clinit>(:79) 
    at e.b.b.c.d(:436) 
    at e.b.b.c.b(:411) 
    at e.b.a.d.b(:176) 
    at com.google.firebase.firestore.f.p.<init>(:131) 
    at com.google.firebase.firestore.b.z.a(:245) 
    at com.google.firebase.firestore.b.z.a(:116) 
    at com.google.firebase.firestore.b.u.run(Unknown Source:8) 
    at com.google.firebase.firestore.g.j.a(:311) 
    at com.google.firebase.firestore.g.f.call(Unknown Source:2) 
    at com.google.firebase.firestore.g.j.a(:287) 
    at com.google.firebase.firestore.g.e.run(Unknown Source:4) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
    at com.google.firebase.firestore.g.j$a.run(:205) 
    at java.lang.Thread.run(Thread.java:764) 
 Caused by: java.lang.NoSuchFieldException: No field streamClosed in class Le/b/b/D$c; (declaration of 'e.b.b.D$c' appears in /data/app/com.wallmann.project_fit_flutter-ow2qlZAyLY4PRx1wLHclMw==/base.apk)
    at java.lang.Class.getDeclaredField(Native Method)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:390)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:389)
    at java.security.AccessController.doPrivileged(AccessController.java:67)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:387) 
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:87) 
    at e.b.b.D.<clinit>(:79) 
    at e.b.b.c.d(:436) 
    at e.b.b.c.b(:411) 
    at e.b.a.d.b(:176) 
    at com.google.firebase.firestore.f.p.<init>(:131) 
    at com.google.firebase.firestore.b.z.a(:245) 
    at com.google.firebase.firestore.b.z.a(:116) 
    at com.google.firebase.firestore.b.u.run(Unknown Source:8) 
    at com.google.firebase.firestore.g.j.a(:311) 
    at com.google.firebase.firestore.g.f.call(Unknown Source:2) 
    at com.google.firebase.firestore.g.j.a(:287) 
    at com.google.firebase.firestore.g.e.run(Unknown Source:4) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
    at com.google.firebase.firestore.g.j$a.run(:205) 
    at java.lang.Thread.run(Thread.java:764) 

2019-12-21 16:05:13.735 21888-21888/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wallmann.project_fit_flutter, PID: 21888
java.lang.RuntimeException: Internal error in Firestore (19.0.0).
    at com.google.firebase.firestore.g.j.a(:379)
    at com.google.firebase.firestore.g.g.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6710)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
 Caused by: java.lang.AbstractMethodError: abstract method "c.b.h.w$d c.b.h.w$d.d(int)"
    at c.b.h.r.a(:1319)
    at c.b.f.a.ka$b.s(:145)
    at c.b.f.a.ka$b.b(:181)
    at c.b.f.a.ka$b.a(:78)
    at c.b.f.a.ka$b$a.a(:428)
    at com.google.firebase.firestore.f.y.a(:699)
    at com.google.firebase.firestore.c.h.a(:213)
    at com.google.firebase.firestore.c.va.c(:103)
    at com.google.firebase.firestore.c.va.a(:142)
    at com.google.firebase.firestore.c.t.a(:530)
    at com.google.firebase.firestore.c.q.run(Unknown Source:6)
    at com.google.firebase.firestore.c.na.a(:180)
    at com.google.firebase.firestore.c.t.a(:520)
    at com.google.firebase.firestore.b.P.a(:178)
    at com.google.firebase.firestore.b.m.a(:91)
    at com.google.firebase.firestore.b.z.b(:152)
    at com.google.firebase.firestore.b.v.run(Unknown Source:4)
    at com.google.firebase.firestore.g.j.a(:311)
    at com.google.firebase.firestore.g.f.call(Unknown Source:2)
    at com.google.firebase.firestore.g.j.a(:287)
    at com.google.firebase.firestore.g.e.run(Unknown Source:4)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at com.google.firebase.firestore.g.j$a.run(:205)
    at java.lang.Thread.run(Thread.java:764)

我可以调试应用程序并运行flutter run --profile,而不会出现问题。我也可以使用flutter build appbundle构建appbundles,但不能使用flutter build apk构建apk。我得到:


    FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':firebase_admob:verifyReleaseResources'.     
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  Output:  /Users/jonas/Projects/ProjectFit/mobile/training_hub_flutter/build/firebase_admob/intermediates/res/merged/release/values/values.xml:208: error: resource android:attr/fontVariationSettings not found.
  /Users/jonas/Projects/ProjectFit/mobile/training_hub_flutter/build/firebase_admob/intermediates/res/merged/release/values/values.xml:209: error: resource android:attr/ttcIndex not found.
  error: failed linking references.  

我对这些问题感到绝望,因此,如果有人提出想法,我将不胜感激。谢谢!

0 个答案:

没有答案