我在Windows 10上安装了Android Studio最新版本。(我已经用另一个版本和另一个Windows 10做了) 它可以用android SDK,但是当它想要加载一个项目时,它说:
错误:(23,17)无法解决:junit:junit:4.12
以及日志:
JsonSyntaxException:在读取distributions时解析异常.json:java.lang.IllegalStateException:预期为BEGIN_ARRAY但在第1行第1行为STRING
gradle.build文件:
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'
}
答案 0 :(得分:3)
添加以下行
android {
...
...
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
...
...
}