title: Retrofit Multipart API above Android Marshmallow getting error java.lang.IllegalStateException: Multipart body must have at least one part
body: <p>I am using retrofit 2 getting error.Its working fine in devices below Android Marshmallow. Above Marshmallow its giving below error</p>
  
  <pre><code>&gt;java.lang.IllegalStateException: Multipart body must have at least one part.
  </code></pre>
  
  <p>Code </p>
  
  <pre><code>    MultipartBody.Builder builder = new MultipartBody.Builder();
      builder.setType(MultipartBody.FORM);
  
  
      try {
          for (int i = 0; i &lt; filePaths.size(); i++) {
              File file = new File(filePaths.get(i));
              String mFileName = App.getInstance().getPrefs().getUserId() + "_" + new Date().getTime() + file.getName();
              builder.addFormDataPart("file[]", mFileName, RequestBody.create(MediaType.parse("multipart/form-data"), file));
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
  
      MultipartBody requestBody = builder.build();
      APIInterface appInterface = APIClient.getClient().create(APIInterface.class);
      Call&lt;ResponseBody&gt; call = appInterface.uploadMultiFile(requestBody);
  
      call.enqueue(new Callback&lt;ResponseBody&gt;() {
          @Override
          public void onResponse(@NonNull Call&lt;ResponseBody&gt; call, @NonNull Response&lt;ResponseBody&gt; response) {
              try {
                  if (response.isSuccessful()) {
                      view.onFileUploaded();
                  } else {
                      view.showToast();
                  }
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
  
          @Override
          public void onFailure(@NonNull Call&lt;ResponseBody&gt; call, @NonNull Throwable t) {
              view.showToast();
          }
      });
  </code></pre>
  
  <p>Can you help me please</p>