I am having the strangest problem. One day, out of the blue, runTransaction simply stopped running completely. no errors. no messages. any print statements i put there never runs. nothing. like as if the runTransaction statement is not there at all.My code is exactly like the example code on the pub. if i just run update or set or add without the transaction it works perfectly.final DocumentReference postRef = Firestore.instance.document('all_tokens/123');Firestore.instance.runTransaction((Transaction tx) async { DocumentSnapshot postSnapshot = await tx.get(postRef); if (postSnapshot.exists) { await tx.update(postRef, <String, dynamic>{'likesCount': postSnapshot.data['likesCount'] + 1}); }else{ await tx.set(postRef, <String, dynamic>{'likesCount': postSnapshot.data['likesCount'] + 1}); } });No error messages at all. nothing in the catch, nothing in then. The entire thing never runs. its like its being skippedhere is my pubspeck.yaml : dependencies: flutter: sdk: flutter http: ^0.12.0 font_awesome_flutter: ^8.2.0 fluttertoast: ^3.0.4 datetime_picker_formfield: ^0.1.7 flutter_image_compress: ^0.4.0 cloud_firestore: ^0.11.0+2 firebase_auth: ^0.11.1 google_sign_in: ^4.0.1+3 firebase_messaging: ^4.0.0+3 shared_preferences: ^0.5.2 firebase_storage: ^3.0.0 flutter_rating: ^0.0.2 flutter_typeahead: ^1.4.0 url_launcher: ^4.0.3 flutter_facebook_login: ^2.0.0 algolia: ^0.1.5 geolocator: ^4.0.3 provider: ^2.0.1 解决方案 I conclude it is a recent version of Flutter that has caused this issue. I recently upgraded to the latest in the master channel and I started having the same problems. Once I downgraded to latest build in the Stable channel, the problem went away.Thanks to crushman1 for reporting this and updating that a downgrade worked for him. Downgrading to latest stable build fixed it for me as well.Steps to downgrade can be found HERE 这篇关于Firestore runTransaction永远不会运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-18 07:03