BLOG main image

분류 전체보기 (321)
free (36)
영화 (85)
드라마 (21)
게임 (28)
만화/책 (34)
개발 (46)
IT (68)
연예 (3)
Visitors up to today!
Today hit, Yesterday hit
TETRIS
rss
2019. 8. 8. 11:33

회사나 방화벽 이슈가 있는 곳에서 안드로이드 스튜디오 빌드를 하려고 하면, 


Gradle 'project_name' project refresh failed: Unable to find valid certification path to requested target



이런식으로 보안 에러가 발생하면서 빌드가 안된다. 



gradle.properties 에서
distributionUrl=http\://services.gradle.org/distributions/gradle-5.1.1-all.zip

https 를 http 로 바꾸면 조금은 진행되지만 빌드가 완료되지는 않는다.



build.gradle 의 repositories 설정에 여러가지를 바꿔봐도 소용이 없다.

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}


maven { url "http://dl.google.com/dl/android/maven2/" }

maven { url "http://jcenter.bintray.com"}



결국,

인증서를 가지고 있다면 keytool 을 이용해서 인증서를 추가해주는게 가장 효과적이다.


keytool -import -noprompt -trustcacerts -alias aliasname -file "C:\\data\\sh256.cer" -keystore "C:\\Program Files\\Android\\Android Studio\\jre\\jre\\lib\\security\\cacerts" -storepass changeit



빌드 과정에서 https://dl.google.com 만 http://dl.google.com 로 바꿀 수 있으면 쉽게 해결될 것 같은데 방법을 못 찾음.


만약 인증서가 없다면?

포기하고 다른 곳에 가서 빌드해야...-_-;