title: OkHTTP error cannot access ByteString
body: <p>I am using OkHttp library to multipart data and everything is good i don't have any error but when i compile the program then it gives me error</p>
  
  <blockquote>
    <p>Error:(172, 40) error: cannot access ByteString
    class file for okio.ByteString not found</p>
  </blockquote>
  
  <p>The error occurs here <code>RequestBody.create(MEDIA_TYPE_JPG, new File(data.getFileParam())))</code></p>
  
  <blockquote>
    <p>Here is the whole code of method that implements multipart request</p>
  </blockquote>
  
  <pre><code>public static String makeRequest(RequestConstructor data, String a, String b) {
      final MediaType MEDIA_TYPE_JPG = MediaType.parse("image/jpg");
      try {
          OkHttpClient client = new OkHttpClient();
  
          Log.d("test",data.getFileParam());
  
          RequestBody requestBody = new MultipartBody.Builder()
                  .setType(MultipartBody.FORM)
                  .addFormDataPart("bunting", data.getParam("bunting"))
                  .addFormDataPart("dangler", data.getParam("dangler"))
                  .addFormDataPart("poster", data.getParam("poster"))
                  .addFormDataPart("tearPad", data.getParam("tearPad"))
                  .addFormDataPart("leafLet", data.getParam("leafLet"))
                  .addFormDataPart("outlet_category", "")
                  .addFormDataPart("dealerName", data.getParam("dealerName"))
                  .addFormDataPart("brouchers", data.getParam("brouchers"))
                  .addFormDataPart("wobblers", data.getParam("wobblers"))
                  .addFormDataPart("tentCard", data.getParam("tentCard"))
                  .addFormDataPart("others", data.getParam("others"))
                  .addFormDataPart("photo", "1.jpg",
                          RequestBody.create(MEDIA_TYPE_JPG, new File(data.getFileParam())))
                  .build();
  
          Request request = new Request.Builder()
                  .url(data.getUrl())
                  .post(requestBody)
                  .build();
  
          Response response = client.newCall(request).execute();
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
          Log.d("From OkHTTP Response", response.toString());
          System.out.println(response.body().string());
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      return null;
  }
  </code></pre>
  
  <p>I don't have any import for okio class so i tried to add manully fun android studio show syntax error <code>cannot resolve symbol okio</code></p>