2017-12-29 49 views
0

AndroidStudio를 사용하여 실행할 수있는 단위 테스트 인 com.android.support.test : runner : 1.0.1을 사용하고 있는데이 명령을 사용하여 프로젝트를 실행하려고하면 내가 Gradle을 2.3.3을 사용하고gradle 명령을 실행했지만 AndroidStudio를 사용하지 않는 중 오류가 발생했습니다.

$ sh gradlew :myproject:clean 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring project ':myproject'. 
> Could not resolve all dependencies for configuration ':myproject:_normalDebugAndroidTestApkCopy'. 
    > Could not find com.android.support:support-annotations:25.0.2. 
    Searched in the following locations: 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/support-annotations/25.0.2/support-annotations-25.0.2.pom 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/support-annotations/25.0.2/support-annotations-25.0.2.jar 
     file:/Users/Joan/Development/myproject/git/android-tag/src/myproject/sdk-manager/com/android/support/support-annotations/25.0.2/support-annotations-25.0.2.jar 
    Required by: 
     project :myproject 
    > Could not find com.android.support.test:runner:1.0.1. 
    Searched in the following locations: 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/test/runner/1.0.1/runner-1.0.1.pom 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/test/runner/1.0.1/runner-1.0.1.jar 
     file:/Users/Joan/Development/myproject/git/android-tag/src/myproject/sdk-manager/com/android/support/test/runner/1.0.1/runner-1.0.1.jar 
    Required by: 
     project :myproject 
    > Could not find com.android.support.test:rules:1.0.1. 
    Searched in the following locations: 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/test/rules/1.0.1/rules-1.0.1.pom 
     file:/Users/Joan/SDKs/android-sdk/extras/android/m2repository/com/android/support/test/rules/1.0.1/rules-1.0.1.jar 
     file:/Users/Joan/Development/myproject/git/android-tag/src/myproject/sdk-manager/com/android/support/test/rules/1.0.1/rules-1.0.1.jar 
    Required by: 
     project :myproject 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 4.437 secs 

그리고 지금 나는 때문에 일부 이전 버전과의 호환성 문제의 최신 하나를 업데이트 할 수 없습니다 : 라인은 나는 다음과 같은 오류를 얻을.

어떻게이 문제를 해결할 수 있습니까? 당신이 당신의 build.gradlemaven { url 'https://maven.google.com' }을 놓친 그런

감사합니다,

답변

1

것 같습니다. 그래서 Maven 캐시 만 검색했습니다.

는이 같은 뭔가를 확인 프로젝트의 build.gradle :

allprojects { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.google.com' } 
    } 
} 

는 또한, 당신은 ./gradlew :myproject:clean 대신 sh gradlew :myproject:clean로 Gradle을 작업을 실행할 수 있습니다.