. Advertisement .
..3..
. Advertisement .
..4..
Android is one Linux-based operating system designed for mobile devices with touch screens, such as smartphones and tablets. Android was initially developed by Android Inc. with financial support from Google before being acquired by Google in 2005. Many of you, like us, may continue to run into problems while using the tool. ” Using insecure protocols with repositories without explicit opt-in is unsupported Switch Maven repository in android”, for example, is one of the most frequently asked errors. So, how do we resolve this? We will discuss together to figure out the best solution.
When Does The Error “Using insecure protocols with repositories without explicit opt-in is unsupported Switch Maven repository in android” Happen?
You recently have updated the android studio, and now you face the following error while running your project.
A problem occurred configuring root project 'so10'.
> Could not resolve all dependencies for configuration ':classpath'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository
'maven3(http://oss.sonatype.org/content/repositories/snapshots)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
The Most Simple Method For The Issue ”Using insecure protocols with repositories without explicit opt-in is unsupported Switch Maven repository in Android”
Solution: Specify a boolean allowInsecureProtocol as true to MavenArtifactRepository closure
To solve the error ”Using insecure protocols with repositories without explicit opt-in is unsupported Switch Maven repository in Android” you must specify a boolean allowInsecureProtocol as true to MavenArtifactRepository closure in Gradle versions 7+. It will help you examine whether communicating with a repository through an unsecured HTTP connection is permissible or not. Now let’s take a look the example below to understand more about this solution.
repositories {
// maven { url "https://maven.fabric.io/public" }
maven {
url "https://jitpack.io"
}
maven {
url "https://raw.github.com/Raizlabs/maven-releases/master/releases"
}
maven {
url "http://oss.sonatype.org/content/repositories/snapshots"
allowInsecureProtocol = true //add this line
}
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://maven.google.com"
}
google()
mavenCentral()
jcenter()
}
This purposefully asks a user to consent to utilize insecure protocols only when necessary for security reasons. On purpose, Gradle doesn’t provide a global system/gradle property that enables a common disablement of this check.
This method is very simple, isn’t it? However, it works very perfectly. After you applying this method, your error will be completely resolved and your program will run well without any problems. So, what are you waiting without applying this method? Let’s use it to get your desired results.
Conclusion
If you’re having trouble with the error “Using insecure protocols with repositories without explicit opt-in is unsupported Switch Maven repository in android“, the solution above is the quickest way out. If you still need advice or have other concerns, there is a growing community where everyone is usually willing to help. Finally, we hope you’re having a good time with the amazing code options and appreciate your reading time.
Read more
Leave a comment