In my project I got an error:
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Then I tried to fix it use this:
compileSdkVersion 23
But then I got error:
cannot resolve symbol NameValuePair android
How to fix this error?
If you want to use NameValuePair or BasicNameValuePair in android studio with latest API Levels. Then follow steps below:
Open build.gradle(Module) file and copy these dependencies:
implementation 'com.google.http-client:google-http-client-android:+' implementation 'com.google.api-client:google-api-client-android:+' implementation 'com.google.api-client:google-api-client-gson:+'
Copy useLibrary 'org.apache.http.legacy'
below buildToolsVersion
like:
android { useLibrary 'org.apache.http.legacy'}
Thats all. Now just sync gradle file.
Note: In dependencies i recommend to use latest version of libraries instead of + symbol.
NameValuePair
is part the package org.apache
which was deprecated with Android 22
and removed with Android M
, which is the version against you are compiling. What is interesting is that neither the documentation of NameValuePair is reachable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With