Skip to content

Instantly share code, notes, and snippets.

E/CloudFirestorePlugin(21506): java.lang.Exception: Do transaction failed.
E/CloudFirestorePlugin(21506): java.util.concurrent.ExecutionException: java.lang.Exception: Do transaction failed.
E/CloudFirestorePlugin(21506): at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
E/CloudFirestorePlugin(21506): at com.google.android.gms.tasks.Tasks.await(Unknown Source:33)
E/CloudFirestorePlugin(21506): at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$4.apply(CloudFirestorePlugin.java:409)
E/CloudFirestorePlugin(21506): at io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin$4.apply(CloudFirestorePlugin.java:361)
E/CloudFirestorePlugin(21506): at com.google.firebase.firestore.FirebaseFirestore.lambda$runTransaction$1(com.google.firebase:firebase-firestore@@19.0.0:283)
E/CloudFirestorePlugin(21506): at com.google.firebase.firestore.FirebaseFirestore$$Lambda$3.call(Unknown Source:6)
E/CloudFirestorePlugin(21506): at com.google.android.gms.tasks.zzv.run(Unknown Source:2)
E/Cl
@creativecreatorormaybenot
creativecreatorormaybenot / main.dart
Created June 21, 2019 07:22
Hero calls initState three times
import 'package:flutter/material.dart';
main() {
runApp(MaterialApp(home: const Page()));
}
class Page extends StatelessWidget {
const Page({Key key}) : super(key: key);
@override
@creativecreatorormaybenot
creativecreatorormaybenot / main.dart
Created June 21, 2019 21:37
Lists of mixed types in Dart
main() {
var data = ["abcd", 34, "ef", false];
int n = data[1];
print(n*2); // -> 68
var otherData = [34, "abcd", "ef", false]; // -> type error
int m = otherData[1];
print(m*2);
}
@creativecreatorormaybenot
creativecreatorormaybenot / gist:dd394363bb0a8dde27a5f3f33b9a9043
Created June 28, 2019 14:48
Firestore increment crashes app on Android
D/AndroidRuntime(10123): Shutting down VM
E/AndroidRuntime(10123): FATAL EXCEPTION: main
E/AndroidRuntime(10123): Process: app, PID: 10123
E/AndroidRuntime(10123): java.lang.RuntimeException: Internal error in Firestore (19.0.0).
E/AndroidRuntime(10123): at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$5(com.google.firebase:firebase-firestore@@19.0.0:379)
E/AndroidRuntime(10123): at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run(Unknown Source:2)
E/AndroidRuntime(10123): at android.os.Handler.handleCallback(Handler.java:873)
E/AndroidRuntime(10123): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(10123): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(10123): at android.app.ActivityThread.main(ActivityThread.java:6669)
@creativecreatorormaybenot
creativecreatorormaybenot / main.dart
Last active July 3, 2019 22:51
Hero inserts after dispose
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(routes: {
'/': (context) => Scaffold(
body: Center(
child: FlatButton(
child: const Text('open'),
onPressed: () => Navigator.of(context).pushNamed('/page'),
),
import 'package:flutter/material.dart';
main() {
runApp(
MaterialApp(
home: Scaffold(
body: Center(
child: Container(
color: Colors.greenAccent,
child: ListTile(
@creativecreatorormaybenot
creativecreatorormaybenot / main.dart
Created July 14, 2019 16:04
RefreshIndicator is broken
import 'package:flutter/material.dart';
main() {
runApp(
MaterialApp(
home: Scaffold(
body: RefreshIndicator(
onRefresh: () async => Future.delayed(Duration(seconds: 1)),
child: ListView.builder(
itemBuilder: (context, index) => ListTile(
class Foo {
output() {
print('q');
}
}
mixin Bar {
output() {
print('w');
}
@creativecreatorormaybenot
creativecreatorormaybenot / gist:b7543271f0e6f80fac44040cab32d09a
Last active July 18, 2019 07:42
sf317, Android 7.0, j3popltespr, Android 6.0
java.lang.RuntimeException:
at com.google.firebase.firestore.util.AsyncQueue.access$000 (AsyncQueue.java)
or .access$100 (AsyncQueue.java)
or .callTask (AsyncQueue.java)
or .containsDelayedTask (AsyncQueue.java)
or .enqueue (AsyncQueue.java)
or .enqueueAfterDelay (AsyncQueue.java)
or .getExecutor (AsyncQueue.java)
or .lambda$callTask$0 (AsyncQueue.java)
or .lambda$callTask$1 (AsyncQueue.java)
java.lang.RuntimeException:
at android.os.AsyncTask$3.done (AsyncTask.java:365)
at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:383)
at java.util.concurrent.FutureTask.setException (FutureTask.java:252)
at java.util.concurrent.FutureTask.run (FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run (AsyncTask.java:257)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:784)
Caused by: java.lang.NullPointerException: