I am getting error while adding OkHttpClient object into retrofit.
Error is: com.google.gson.JsonSyntaxException: java.lang.IllegalStat
Note that Retrofit 2 relies on OkHttp for its network operations Hence you will not need to add OkHttp dependency explicitly once you have added the retrofit2. I believe that could be causing the version conflict.
Edit: Use beta 3 for both retrofit and gson
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:retrofit-converters:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3