Issue 1:
Steps to Reproduce

... deal flutter build apk

...

...

Logs

Reading input...
Reading program jar [D:\FlutterSDK\flutterSdkUp\flutter\bin\cache\artifacts\engine\android-arm-release\flutter.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\sdk-2.12.5.0.aar\69d585b47560b80838e0320cdea510f7\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.tencent.mm.opensdk\wechat-sdk-android-without-mta\1.4.0\6d9332f6999746b8fbda27659744f23e5dd27021\wechat-sdk-android-without-mta-1.4.0.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-v4-27.1.1.aar\207a5c58f369141f2b579675c7c9b49c\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-media-compat-27.1.1.aar\ef2d0c15837087a672dfad0bc1414f63\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-fragment-27.1.1.aar\8d045f8acabc8ceae40863e4ca8b6785\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.1.aar\eda8615aa2110b28c33a97a9507ef161\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-core-utils-27.1.1.aar\bf2d85f29110f5f714ade3ddc5816d32\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aar\7a014764b6a3cafe6fb4602242f1df12\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-lite\3.0.1\59b5b9c6e1a3054696d23492f888c1f8b583f5fc\protobuf-lite-3.0.1.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.android.support\support-annotations\27.1.1\39ded76b5e1ce1c5b2688e1d25cdc20ecee32007\support-annotations-27.1.1.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\runtime-1.1.0.aar\cd4240276775951ba2a8eb41cb918a06\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\livedata-core-1.1.0.aar\be9ac40849b2a5f12f41661aa64b5c6f\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\viewmodel-1.1.0.aar\c377007519d29db9af37170c97fdd1ee\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\android.arch.lifecycle\common\1.1.0\edf3f7bfb84a7521d0599efa3b0113a0ee90f85\common-1.1.0.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\runtime-1.1.0.aar\584604e38b0ba1f26d8b9b2eec4d8517\jars\classes.jar] (filtered)
Reading program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\android.arch.core\common\1.1.0\8007981f7d7540d89cd18471b8e5dcd2b4f99167\common-1.1.0.jar] (filtered)
Reading program jar [D:\Achers\FlutterO2O\o2o\build\shared_preferences\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program jar [D:\Achers\FlutterO2O\o2o\build\url_launcher\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program jar [D:\Achers\FlutterO2O\o2o\build\image_picker\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program jar [D:\Achers\FlutterO2O\o2o\build\flutter_blue\intermediates\intermediate-jars\release\classes.jar] (filtered)
Reading program directory [D:\Achers\FlutterO2O\o2o\build\app\intermediates\classes\release] (filtered)
Reading program jar [D:\Achers\FlutterO2O\o2o\build\app\intermediates\transforms\mergeJavaRes\release\0.jar] (filtered)
Reading library jar [D:\android-sdk-windows\platforms\android-27\android.jar]
Reading library jar [D:\android-sdk-windows\platforms\android-27\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.HttpResponseCache]
Note: there were 11 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Initializing...
Note: the configuration refers to the unknown class 'fqcn.of.javascript.interface.for.webview'
Note: the configuration refers to the unknown class 'com.alibaba.android.arouter.facade.template.ISyringe'
Note: the configuration refers to the unknown class 'com.bumptech.glide.module.GlideModule'
Note: the configuration refers to the unknown class 'com.talkingdata.sdk.TalkingDataSDK'
Note: com.google.protobuf.ExtensionRegistryFactory: can't find dynamically referenced class com.google.protobuf.ExtensionRegistry
Note: com.google.protobuf.ExtensionRegistryLite: can't find dynamically referenced class com.google.protobuf.Extension
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.xiaomi.MiuiPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.meizu.FlymePushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.huawei.HmsPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.oppo.OppoPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.fcm.FcmPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.xiaomi.MiuiPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.meizu.FlymePushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.huawei.HmsPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.oppo.OppoPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.igexin.assist.control.fcm.FcmPushManager
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.xiaomi.mipush.sdk.MiPushClient
Note: com.igexin.assist.sdk.a: can't find dynamically referenced class com.meizu.cloud.pushsdk.PushManager
Note: com.igexin.push.core.a.a.g: can't find dynamically referenced class com.android.internal.R$id
Note: com.igexin.push.extension.distribution.basic.a.o: can't find dynamically referenced class com.android.internal.R$id
Note: com.igexin.push.extension.distribution.basic.a.o: can't find dynamically referenced class com.android.internal.R$id
Note: com.igexin.push.extension.distribution.basic.g.e.b: can't find dynamically referenced class com.android.internal.R$id
Note: com.igexin.push.extension.distribution.basic.l.a: can't find dynamically referenced class android.app.MiuiNotification
Note: com.igexin.push.extension.distribution.basic.l.b: can't find dynamically referenced class com.igexin.assist.control.xiaomi.MiuiPushManager
Note: com.igexin.push.extension.distribution.basic.l.b: can't find dynamically referenced class com.igexin.assist.control.meizu.FlymePushManager
Note: com.igexin.push.extension.distribution.basic.l.b: can't find dynamically referenced class com.xiaomi.mipush.sdk.MiPushClient
Note: com.igexin.push.extension.distribution.basic.l.b: can't find dynamically referenced class com.meizu.cloud.pushsdk.PushManager
Note: com.igexin.push.extension.distribution.basic.l.d: can't find dynamically referenced class android.os.ServiceManager
Note: com.igexin.push.extension.distribution.gbd.i.k: can't find dynamically referenced class android.os.SystemProperties
Note: com.igexin.push.util.a: can't find dynamically referenced class android.os.ServiceManager
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONArray'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONException'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONObject'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONStringer'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONTokener'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONArray'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONException'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONObject'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONStringer'
Note: the configuration explicitly specifies 'org.json.**' to keep library class 'org.json.JSONTokener'
Note: there were 4 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 10 library classes explicitly being kept.
You don't need to keep library classes; they are already left unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#libraryclass)
Note: there were 26 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Ignoring unused library classes...
Original number of library classes: 4610
Final number of library classes: 1272
Printing kept classes, fields, and methods...
Shrinking...
Printing usage to [D:\Achers\FlutterO2O\o2o\build\app\outputs\mapping\release\usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 2275
Final number of program classes: 2271
Obfuscating...
Printing mapping to [D:\Achers\FlutterO2O\o2o\build\app\outputs\mapping\release\mapping.txt]...
Writing output...
Preparing output jar [D:\Achers\FlutterO2O\o2o\build\app\intermediates\transforms\proguard\release\0.jar]
Copying resources from program jar [D:\FlutterSDK\flutterSdkUp\flutter\bin\cache\artifacts\engine\android-arm-release\flutter.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\sdk-2.12.5.0.aar\69d585b47560b80838e0320cdea510f7\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.tencent.mm.opensdk\wechat-sdk-android-without-mta\1.4.0\6d9332f6999746b8fbda27659744f23e5dd27021\wechat-sdk-android-without-mta-1.4.0.
jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-v4-27.1.1.aar\207a5c58f369141f2b579675c7c9b49c\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-media-compat-27.1.1.aar\ef2d0c15837087a672dfad0bc1414f63\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-fragment-27.1.1.aar\8d045f8acabc8ceae40863e4ca8b6785\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.1.aar\eda8615aa2110b28c33a97a9507ef161\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-core-utils-27.1.1.aar\bf2d85f29110f5f714ade3ddc5816d32\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.1.aar\7a014764b6a3cafe6fb4602242f1df12\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-lite\3.0.1\59b5b9c6e1a3054696d23492f888c1f8b583f5fc\protobuf-lite-3.0.1.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\com.android.support\support-annotations\27.1.1\39ded76b5e1ce1c5b2688e1d25cdc20ecee32007\support-annotations-27.1.1.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\runtime-1.1.0.aar\cd4240276775951ba2a8eb41cb918a06\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\livedata-core-1.1.0.aar\be9ac40849b2a5f12f41661aa64b5c6f\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\viewmodel-1.1.0.aar\c377007519d29db9af37170c97fdd1ee\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\android.arch.lifecycle\common\1.1.0\edf3f7bfb84a7521d0599efa3b0113a0ee90f85\common-1.1.0.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\transforms-1\files-1.1\runtime-1.1.0.aar\584604e38b0ba1f26d8b9b2eec4d8517\jars\classes.jar] (filtered)
Copying resources from program jar [C:\Users\62682\.gradle\caches\modules-2\files-2.1\android.arch.core\common\1.1.0\8007981f7d7540d89cd18471b8e5dcd2b4f99167\common-1.1.0.jar] (filtered)
Copying resources from program jar [D:\Achers\FlutterO2O\o2o\build\shared_preferences\intermediates\intermediate-jars\release\classes.jar] (filtered)
Copying resources from program jar [D:\Achers\FlutterO2O\o2o\build\url_launcher\intermediates\intermediate-jars\release\classes.jar] (filtered)
Copying resources from program jar [D:\Achers\FlutterO2O\o2o\build\image_picker\intermediates\intermediate-jars\release\classes.jar] (filtered)
Copying resources from program jar [D:\Achers\FlutterO2O\o2o\build\flutter_blue\intermediates\intermediate-jars\release\classes.jar] (filtered)
Copying resources from program directory [D:\Achers\FlutterO2O\o2o\build\app\intermediates\classes\release] (filtered)
Copying resources from program jar [D:\Achers\FlutterO2O\o2o\build\app\intermediates\transforms\mergeJavaRes\release\0.jar] (filtered)
Printing classes to [D:\Achers\FlutterO2O\o2o\build\app\outputs\mapping\release\dump.txt]...
Gradle task 'assembleRelease'... Done 13.5s
Built build\app\outputs\apk\release\app-release.apk (17.4MB).

-->

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

• Flutter version 0.11.3 at D:\FlutterSDK\flutterSdkUp\flutter
• Framework revision 72bf075e8d (6 days ago), 2018-11-09 20:36:17 -0800
• Engine revision 5646e86a6f
• Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)

[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at D:\android-sdk-windows
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = D:\android-sdk-windows
• Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
• All Android licenses accepted.

[√] Android Studio (version 3.0)
• Android Studio at D:\Program Files\Android\Android Studio
• Flutter plugin version 23.2.1
• Dart plugin version 171.4424
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Connected device (1 available)
• SM G9350 • 41d574b4 • android-arm64 • Android 8.0.0 (API 26)

• No issues found!

Issue 2:
We have an issue with Flutter connected to Cloud Firestore in offline mode.

Specifically, if you have a ListView builder that displays data from a Firestore Collection:

StreamBuilder<QuerySnapshot>(
stream: Firestore.instance.collection('flutter_data').snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData ||
snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
}

return FirestoreListView(documents: snapshot.data.documents);
},
)

and you have a button that adds data to Firestore :

void addTitle(String text) {

Map<String, String> data = {'title': text};
Firestore.instance.runTransaction((Transaction tx) async {
var snapshot = await tx.get(Firestore.instance.document('flutter_data'));
await tx.set(snapshot.reference, data);
});
}

Then assuming we have no network connection and add say the title -> test12345 , our listview builder will show the string test12345 approx 5 times - we then turn on the connection, our app will then throw a PlatformException with the error :

**errorCode = 9**
**message = Transaction failed all retries**

And stack trace

> "LocalDownloadTask <3109D0D9-C5AA-456D-8A15-B6DFB23DA3B8>.<1>"
> ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:841219028691:ios:4435fb28c55b69f4?platform=ios&app_instance_id=D2667171446D4FB3BBEDA454B4D5B89E&gmp_version=50200, NSErrorFailingURLKey=https://app-measurement.com/config/app/1:841219028691:ios:4435fb28c55b69f4?platform=ios&app_instance_id=D2667171446D4FB3BBEDA454B4D5B89E&gmp_version=50200, _kCFStream [<decode: missing data>]
> 5.9.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1003, Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x600001fdc180 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <3109D0D9-C5AA-456D-8A15-B6DFB23DA3B8>.<1>, _NSURLErrorRelatedURLSessionTaskError

More importantly, we now have '5' documents in Firestore - it appears that when in offline mode, for each retry that the local client sdk does, it stores the document that many times in Firestore and thus causes duplicates - we were only expecting ONE document to be added in Firestore.

We therefore have two issues

Our stream gets a new event from the client cache for each time it trys to add to cloud firestore

Cloud firestore incorrectly batches all the retries for the same document and duplicates the data on cloud firestore

For issue 1

We are yet to find a workaround

For issue 2

Ideally we would like to be able to interrogate something like a querysnapshot meta data and determine if the event that we receive from the stream is from the local cache , if so - we would check to see if we have already shown the new item in our listview and if so, just ignore the event., However - we cannot find anything that will give us access to this information.