drulabs
drulabs

Reputation: 3121

Failed to find target with hash string 'android-23' in Android Studio 2.0 preview beta 2

Gradle sync fails in Android Studio 2.0 preview beta 2. My project used to work perfectly in older previews, but since preview 9 gradle sync fails with error:

failed to find target with hash string 'android-23'

I've tried changing compile and target SDK versions but no change.

Upvotes: 1

Views: 817

Answers (3)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75798

The build classpath specifies which Java source files and resource files in a project are considered by the Java builder and specifies how to find types outside of the project. The Java builder compiles the Java source files into the output folder and also copies the resources into it. The build classpath is specified for each project.

You should use

 dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-beta2' // or beta3
}

alpha9

Sometimes this stage is referred to as a preview version. Sometimes no more features are added after this release, but bug fixes continue. This release comes after a pre-alpha version and before a beta version.

Upvotes: 1

pRaNaY
pRaNaY

Reputation: 25320

Just change you build.gradle classpath with com.android.tools.build:gradle:2.0.0-beta2 like below while using Android studio 2.0 beta 2:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-beta2'
}

Upvotes: 0

drulabs
drulabs

Reputation: 3121

The issue seems to be with gradle plugin. alpha9 is buggy.

avoid 2.0.0-alpha9

use 2.0.0-beta2

in your project gradle file.

Works with preview 9 and beta 2 versions of android studio.

Upvotes: 0

Related Questions