最佳答案
我有一个简单的类写在Android Studio:
package com.mysite.myapp;
import org.apache.http.client.HttpClient;
public class Whatever {
public void headBangingAgainstTheWallExample () {
HttpClient client = new DefaultHttpClient();
}
}
从这里我得到了以下编译时错误:
Cannot resolve symbol HttpClient
HttpClient
不是包含在Android Studio SDK中吗?即使不是,我也像这样把它添加到我的Gradle构建中:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'org.apache.httpcomponents:httpclient:4.5'
}
不管有没有最后一个编译行,错误都是一样的。我错过了什么?