Failed to resolve: junit:junit : 4.12 solutions
:
causes:
the code in JUnit library is referenced in the project, but there is no related JUnit dependent library yet
solutions:
method 1: add related dependency libraries; Method 2: delete references related to JUnit
1. Add the following code to the build.gradle of the module of the project 2
repositories { maven { url 'http://repo1.maven.org/maven2' } }
2. Delete the reference to JUnit in build.gradle of the module of the project 2
Delete the following sentence
testCompile 'junit:junit:4.12'
but with the second method, there will be a problem after deletion. In SRC java code, errors will be reported where JUnit library related code is used. At this time, we have to delete these references to JUnit. If you don’t need to do unit testing, you can delete JUnit related things, but it’s better to use the first method, Keep the function of unit testing
Similar Posts:
- Android Studio: Could not download junit.jar (junit:junit:4.12)
- How to Solve compile error: package junit.framework does not exist
- [Solved] Gradle Error: Could not find method api() for arguments….
- [Solved] Could not resolve dependencies for project xxx: Could not find artifact xxx
- Spring @Async interrupt/Unable to acquire JDBC Connection
- Build failed for Android studio new project
- [Solved] Cannot resolve symbol ‘SpringJUnit4ClassRunner’
- AS Import Project Error: Plugin with id ‘com.android.application’ not found.
- [Solved] IDEA Error: Failed to resolve org.junit.platform:junit-platform-launcher
- [Solved] java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter