有谁知道如何解决这个问题? 我尝试构建我的应用程序,但是我收到一个错误,它不同步或者那些行,所以我搜索了错误。
找到一个解决方案,说我必须删除其中一个.gradle文件,所以我做了,然后在尝试再次构建应用程序时发生了这个错误。
I am new to android and java development and have no idea how to fix this.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugAndroidTestApkCopy'.
> Could not find com.squareup:javawriter:2.1.1.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find javax.inject:javax.inject:1.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find org.hamcrest:hamcrest-library:1.3.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find org.hamcrest:hamcrest-integration:1.3.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find com.google.code.findbugs:jsr305:2.0.1.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find javax.annotation:javax.annotation-api:1.2.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2
> Could not find junit:junit:4.12.
Required by:
JustJava:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2 > com.android.support.test:runner:0.5
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
这是build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.android.justjava"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
}