Cannot get started
stevebroshar opened this issue · comments
I created a new project using the latest Android Studio. It's a Java project using Groovy DSL (build.gradle). But can't get any further.
Instructions say:
First, add it in your root build.gradle or settings.gradle at the end of repositories:
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
What exactly does "it" refer to here?
Which build.gradle?
Does it go into build.gradle or settings.gradle?
Do i need to add the whole block? or just part of it?
I don't find "allprojects" in any project file.
I did add "implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:latest_tag'" to the app build.gradle, but build fails with error: "Could not find com.github.jiangdongguo.AndroidUSBCamera:libausbc:latest_tag."
I did try adding jcenter and maven{...} lines to the pluginManagement and dependencyResolutionManagement blocks in the settings.gradle file, but still get "could not find..." error. If I add the whole allprojects block to settings.gradle I get error: "Gradle DSL method not found: 'allprojects()'"
I added to dependencyResolutionManagement this way. it is working for me. you can try
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}