0
안드로이드 스튜디오에서 에뮬레이터에 내 응용 프로그램을 실행할 때 나는 치명적 오류를 받고 있어요 :오류
모듈 내 build.gradle의java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of 'org.apache.http.message.BasicLineFormatter' appears in /system/framework/ext.jar)
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.htw.roishachor.dbplanupdater"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
내 코드 :
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.*;
import org.apache.http.client.methods.HttpGet;
public void myMethod() {
CloseableHttpResponse response = null;
try{
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpget = new HttpGet(new URI(INITIAL_URL));
response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); ....
이상한 일이
. 나는 그것과 관련이 있는지 모른다. 내 libs와 build 폴더는 AndroidStudio에서 볼 수 없기 때문에 익스플로러에서만 볼 수있다. 튜토리얼에서 각 .jar 파일을 마우스 오른쪽 버튼으로 클릭하고 라이브러리로 추가해야한다는 것을 알았습니다. 그것과 관련이 있습니까? 항아리 내 lib 폴더 안에있는,하지만 언급 한 바와 같이, 난 단지 그들이 내 탐험가에게