6

i installed Android Studio latest version on windows 10.(what i already did with another version and another windows 10) it's OK with android SDK but when it wants to load a project it said this:

Error:(23, 17) Failed to resolve: junit:junit:4.12

and here's the log:

JsonSyntaxException: Parse exception while reading distributions.json: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $

gradle.build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.mohammad.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
}
2
  • please share build.gradle file
    – Pooya
    May 15, 2016 at 5:31
  • @Pooya added the code
    – Mike
    May 15, 2016 at 5:36

1 Answer 1

3

add the following lines

android {
 ...
 ...
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
}
...
...
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.