brunch

You can make anything
by writing

C.S.Lewis

by 오준석 Jul 26. 2017

Android Studio junit4.12 관련 에러

24시간 삽질

발단

학원 수강생 중에 갑자기 빌드가 안 된다며 안드로이드 스튜디오 재설치, 윈도우 재설치를 몇 번을 해도 안 되는 경우가 발생하였다.

에러 내용은 다음과 같았다.


Failed to resolve:junit:junit:4.12

Failed to resolve:javax.inject:javax.inject:1

Failed to resolve:javax.annotation:javax.annotation-api:1.2

Failed to resolve:com.google.code.findbugs.jsr305:2.0.1

Failed to resolve:org.hamcrest:hamcrest-library:1.3

Failed to resolve:org.hamcrest:hamcrest-integration:1.3

Failed to resolve:com.squareup:javawriter:2.1.1


junit 관련하여 다양한 에러 발생


과정

안드로이드 스튜디오 재설치, 윈도우 포멧, 다른 PC에 설치, 잘 되는 곳에서 복사 붙여넣기. 

뭘 해도 해결이 안 되었다.



해결방안

원인은 어쨌든 junit 을 그레이들 설정에서 의존성 제거를 한다. 그럼 espresso 에서 또 에러가 나는데 이것 관련한 부분도 제거 한다.


[ build.gradle ]

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    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.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}


잘 된다.


원인은 아직도 모르겠다. 일단 당장 테스트 프레임워크를 쓰지 않아서 지우고 빌드 하시고 계심.

매거진의 이전글 오버워치 전적검색기 앱 죽였다 살린 삽질기
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari