title: Flutter - Record voice and upload it to firebase
body: <p>I'm using <code>flutter_sound</code> to record audio and <code>firebase_storage</code> for uploading.</p>
  
  <p>Recording is managed by these 2 functions:</p>
  
  <pre><code>  void startRecording() async {
      result = await flutterSound.startRecorder(null);
      aname = result;
      print('startRecorder: $result');
  
      _recorderSubscription = flutterSound.onRecorderStateChanged.listen((e) {
        if(e  != null) {
          DateTime date = new DateTime.fromMillisecondsSinceEpoch(e.currentPosition.toInt());
          String txt = DateFormat('mm:ss:SS', 'en_US').format(date);
        }
      });
    }
  
    void stopRecording() async {
      if(flutterSound.isRecording) result = await flutterSound.stopRecorder();
    }
  </code></pre>
  
  <p>The print statements print the following:</p>
  
  <pre><code>I/flutter (11507): startRecorder: /data/user/0/com.example.appx/app_flutter/null
  I/flutter (11507): stopRecorder: /data/user/0/com.example.appx/app_flutter/null
  </code></pre>
  
  <p>Uploading should be done by this code:</p>
  
  <pre><code>  var uuid = Uuid();
    String aname = uuid.v4();
    final StorageReference storageRef = FirebaseStorage.instance.ref().child('recordings');
    final StorageUploadTask uploadTask = storageRef.putFile(
      File(aname),
      StorageMetadata(
        contentType: 'audio/aac',
      ),
    );
    final StorageTaskSnapshot downloadUrl = (await uploadTask.onComplete);
    final String url = (await downloadUrl.ref.getDownloadURL());
  
  </code></pre>
  
  <p>but I get the following error when I try to get the URL:</p>
  
  <pre><code>Running Gradle task 'assembleProfile'...                                
  E/flutter (11507): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(download_error, The operation retry limit has been exceeded., null)
  E/flutter (11507): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569)
  E/flutter (11507): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321)     
  E/flutter (11507): &lt;asynchronous suspension&gt;                                                                       
  E/flutter (11507): #2      StorageReference.getDownloadURL (package:firebase_storage/src/storage_reference.dart:142)
  E/flutter (11507): #3      updateUserAlert (package:electroshoex/utils.dart:58)                                    
  E
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thank you. :)</p>