-1

I want to add okhttp to my project but even after i added it , android studio says Cannot resolve symbol for OkHttpClient

OkHttpClient client = new OkHttpClient();

enter image description here

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
user2650277
  • 6,289
  • 17
  • 63
  • 132
  • 1
    that's not the correct way to add jar files. The way you did is for adding extra modules in your project. To add a jar put in libs folder – Vivek Mishra Feb 22 '16 at 05:05
  • 2
    http://stackoverflow.com/questions/25660166/how-to-add-a-jar-in-external-libraries-in-android-studio look into this – Maheshwar Ligade Feb 22 '16 at 05:06

3 Answers3

0

Just Add this dependency in your build.gradle file compile 'com.squareup.okhttp3:okhttp:3.1.2' and build the project your problem will get solved.

Javed Salat
  • 526
  • 4
  • 10
  • 26
0

enter image description here

  1. First You select the project area and in second you get the libs folder.

enter image description here

Rohit Heera
  • 2,709
  • 2
  • 21
  • 31
0

If you want to add a JAR file to your project, then do following steps:

  1. Copy the JAR file into folder app/libs.

  2. Right click on the JAR file and select "add as library".

Martin Zabel
  • 3,589
  • 3
  • 19
  • 34
Bajirao Shinde
  • 1,356
  • 1
  • 18
  • 26