私はアンドロイドアプリ開発の初心者で、今月はアンドロイドスタジオで働いています。以前は、問題なくたくさんのプロジェクトを作成していました。新しいプロジェクトを作成したときに、この奇妙なエラーを受け取ったのは 2 日間のことです。
Error:Unable to find method 'org.apache.http.impl.client.DefaultHttpClient.setRedirectStrategy(Lorg/apache/http/client/RedirectStrategy;)V'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
また、Androidスタジオをアンインストールして再度インストールしましたが、まだうまく機能せず、以前のプロジェクトもこの新しいAndroidスタジオでは機能しません。
これは私のbuild.gradleがどのように見えるかです:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
compileSdkVersion 22
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
}
productFlavors {
}
}
dependencies {
}