Repository: flutter
Issue: Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Tag mismatch!
Labels: c: crash,platform-android,tool,t: gradle,P2,team-android,triaged-android

Hi, since I upgraded Flutter I'm getting the following errors whenever I try to run any project. I've tried flutter clean, I've tried reinstalling, and searching for more info on how to fix this error but I'm getting nowhere. It was working perfectly fine before I upgraded Flutter. I'm a beginner at this so any help would be appreciated, I've exhausted my options right now. This was from a completely new blank project with no files modified:

```
C:\Users\Simon\AndroidStudioProjects\flutter_app>flutter run -v
[ +118 ms] executing: [C:\Users\Simon\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +56 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 2ae34518b87dd891355ed6c6ea8cb68c4d52bb9d
[        ] executing: [C:\Users\Simon\flutter/] git tag --contains HEAD
[ +174 ms] Exit code 0 from: git tag --contains HEAD
[        ] 1.20.1
[   +8 ms] executing: [C:\Users\Simon\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +29 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\Users\Simon\flutter/] git ls-remote --get-url origin
[  +27 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +67 ms] executing: [C:\Users\Simon\flutter/] git rev-parse --abbrev-ref HEAD
[  +35 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +49 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +28 ms] executing: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[  +40 ms] List of devices attached
           emulator-5554          device product:sdk_gphone_x86 model:sdk_gphone_x86 device:generic_x86_arm transport_id:1
[   +7 ms] C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[  +42 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +216 ms] Generating C:\Users\Simon\AndroidStudioProjects\flutter_app\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +23 ms] ro.hardware = ranchu
[  +25 ms] Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
[  +32 ms] Starting incremental build...
[   +3 ms] Initializing file store
[   +9 ms] Skipping target: gen_localizations
[   +7 ms] complete
[   +4 ms] Launching lib\main.dart on sdk gphone x86 in debug mode...
[   +5 ms] C:\Users\Simon\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\Users\Simon\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\Users\Simon\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names -Ddart.developer.causal_async_stacks=true --output-dill
C:\Users\Simon\AppData\Local\Temp\flutter_tools.1e7d2c25\flutter_tool.97138df7\app.dill --packages .packages -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions --enable-asserts --track-widget-creation
--filesystem-scheme org-dartlang-root --initialize-from-dill build\cache.dill.track.dill
[  +18 ms] executing: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[  +39 ms] Exit code 0 from: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[        ] --------- beginning of main
           08-07 14:57:07.199 D/DownloadManager( 4752): onStopJob id=16, reason=cancel() called by app, callingUid=10067 uid=10067 jobId=16
[   +1 ms] executing: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[  +39 ms] Exit code 0 from: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[        ] --------- beginning of main
           08-07 14:57:07.199 D/DownloadManager( 4752): onStopJob id=16, reason=cancel() called by app, callingUid=10067 uid=10067 jobId=16
[  +12 ms] <- compile package:flutter_app/main.dart
[   +8 ms] executing: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe version
[  +41 ms] Android Debug Bridge version 1.0.41
           Version 30.0.4-6686687
           Installed as C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +3 ms] executing: C:\Users\Simon\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +29 ms] Building APK
[  +17 ms] Running Gradle task 'assembleDebug'...
[   +2 ms] gradle.properties already sets `android.enableR8`
[   +4 ms] Using gradle from C:\Users\Simon\AndroidStudioProjects\flutter_app\android\gradlew.bat.
[   +4 ms] C:\Users\Simon\AndroidStudioProjects\flutter_app\android\gradlew.bat mode: 33279 rwxrwxrwx.
[   +7 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +101 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
           OpenJDK 64-Bit Server VM (build 25.242-b01, mixed mode)
[   +3 ms] executing: [C:\Users\Simon\AndroidStudioProjects\flutter_app\android/] C:\Users\Simon\AndroidStudioProjects\flutter_app\android\gradlew.bat -Pverbose=true
-Ptarget-platform=android-x86 -Ptarget=C:\Users\Simon\AndroidStudioProjects\flutter_app\lib\main.dart -Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root assembleDebug
[ +214 ms] Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
[+1153 ms] ................................................
[   +4 ms] Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Tag mismatch!
[   +6 ms]      at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1533)
[   +3 ms]      at sun.security.ssl.AppInputStream.available(AppInputStream.java:60)
[        ]      at java.io.BufferedInputStream.available(BufferedInputStream.java:410)
[        ]      at sun.net.www.MeteredStream.available(MeteredStream.java:170)
[        ]      at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:85)
[        ]      at java.io.FilterInputStream.close(FilterInputStream.java:181)
[        ]      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:3527)
[        ]      at org.gradle.wrapper.Download.downloadInternal(Download.java:77)
[        ]      at org.gradle.wrapper.Download.download(Download.java:44)
[        ]      at org.gradle.wrapper.Install$1.call(Install.java:61)
[   +1 ms]      at org.gradle.wrapper.Install$1.call(Install.java:48)
[        ]      at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
[        ]      at org.gradle.wrapper.Install.createDist(Install.java:48)
[        ]      at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
[        ]      at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
[        ] Caused by: javax.net.ssl.SSLException: Tag mismatch!
[        ]      at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
[        ]      at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
[        ]      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1022)
[        ]      at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:933)
[        ]      at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
[        ]      at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
[        ]      at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
[        ]      at sun.net.www.MeteredStream.read(MeteredStream.java:134)
[        ]      at java.io.FilterInputStream.read(FilterInputStream.java:133)
[        ]      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3454)
[        ]      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3447)
[        ]      at org.gradle.wrapper.Download.downloadInternal(Download.java:62)
[        ]      ... 7 more
[        ] Caused by: javax.crypto.AEADBadTagException: Tag mismatch!
[        ]      at com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:592)
[        ]      at com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1116)
[        ]      at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1053)
[        ]      at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:941)
[        ]      at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:491)
[        ]      at javax.crypto.Cipher.doFinal(Cipher.java:2376)
[        ]      at sun.security.ssl.CipherBox.decrypt(CipherBox.java:461)
[        ]      at sun.security.ssl.InputRecord.decrypt(InputRecord.java:172)
[   +2 ms]      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1017)
[        ]      ... 16 more
[  +73 ms] Running Gradle task 'assembleDebug'... (completed in 1.6s)
[+5011 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +2 ms] "flutter run" took 7,305ms.
[   +4 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:591:7)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:860:18)
           #3      _rootRunUnary (dart:async/zone.dart:1198:47)
           #4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
           #10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
           #11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
           #12     _rootRunUnary (dart:async/zone.dart:1198:47)
           #13     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #14     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #16     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #17     Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #18     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
           #19     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
           #20     AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
           #21     _rootRunUnary (dart:async/zone.dart:1198:47)
           #22     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #23     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #24     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #25     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #26     Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #27     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
           #28     _rootRun (dart:async/zone.dart:1190:13)
           #29     _CustomZone.run (dart:async/zone.dart:1093:19)
           #30     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
           #31     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
           #32     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
           #33     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
           #34     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
           #35     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
           
           
[ +212 ms] ensureAnalyticsSent: 210ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +4 ms] Shutdown hooks complete
[   +4 ms] exiting with code 1

```