I 've met such error when I use Android studio 3.1 to build an Android P 's app, the apk can be made ,but when I use it on Android P emulator , it will crash and throw below info, more details see the pic.
java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion
part of my build.gradle under App module is below , anybody meet this ?And give some suggesstion ? Many thanks.
android {
compileSdkVersion 'android-P'
buildToolsVersion '28-rc1'
useLibrary 'org.apache.http.legacy'
//for Lambda
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 17
targetSdkVersion 27
versionCode xxxx
versionName "Vx.x.x"
multiDexEnabled true
//other setting required
ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'armeabi-v8a', 'x86', 'x86_64', 'mips', 'mips64'
}