Workspace/Android
[Gradle][Unity] Using insecure protocols with repositories, without explicit opt-in, is unsupported
Bombus
2023. 8. 18. 11:43
| 현상
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unityLibrary:parseReleaseLocalResources'.
> Could not resolve all dependencies for configuration ':unityLibrary:androidApis'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven4(http://maven.singular.net)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
Unity3d를 2021.3.22f1버전에서 2022.3.6f1버전으로 업그레이드 하면서
그래들 버전이 달라져서 그런지 http 리포지터리를 허용하지 않았다.
| 해결
1. 사용하고 있는 Plugin을 최신화
Plugin이 업데이트 되면서 repository가 변경되었을 수 있기 때문
2. Plugin내부 Dependencies.xml 파일 수정
<dependencies>
<androidPackages>
<repositories>
<repository>https://repo.maven.apache.org/maven2</repository>
... 중략...
</repositories>
</androidPackages>
</dependencies>
임시방편으로 해당 repository를 secure protocol로 변경한다.
3. allowInsecureProtocol 설정
repositories {
maven {
url "http://..."
allowInsecureProtocol true
}
mavenCentral()
}
| 참고
MavenArtifactRepository - Gradle DSL Version 8.3
An artifact repository which uses a Maven format to store artifacts and meta-data. Repositories of this type are created by the RepositoryHandler.maven(org.gradle.api.Action) group of methods. PropertyDescriptionallowInsecureProtocolSpecifies whether it is
docs.gradle.org
반응형