An error occurred configuring root project 'BoomMenu-master' - java

When I am importing the project, I am getting the following error:
Error:A problem occurred configuring root project 'BoomMenu-master'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4.
Required by: :BoomMenu-master:unspecified
> No cached version of com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4 available for offline mode.
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3. Required by:
:BoomMenu-master:unspecified
> No cached version of com.github.dcendents:android-maven-gradle-plugin:1.3 available for
offline mode.

There are some solution which i had applied previously that ,
1 . Try to rebuild your project for 2 to 3 times.
2 . Open your build.gradle file and then add line at top that these lines ,here you must choose build gradle version according to your sdk .
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
3. Open your library build.gradle file say in yours you must open boommenu file .
add these lines at top ,
apply plugin: 'com.android.application'
4.Try to changed proxyPort to 8080 and used jcenter instead of Maven. But i had to apply expeption to use HTTP instead of HTTPS. This is what i have in my gradle.build for build script and allprojects
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}

Related

A problem occurred configuring root project. What do I need to do?

I just created a new android project to test something separate to my main one, and this happened. I tried it several times and get the same error every time.
A problem occurred configuring root project 'login_test'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
try to change version of kotlin in build.gradle under the root directory.I use 1.3.72 here
buildscript {
ext.kotlin_version = '1.0.0'
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

How do I install jtransc?

The jtransc Github README shows there is a gradle plugin I can add with:
plugins {
id "com.jtransc" version "0.6.8"
}
But whenever I sync the project it shows the following error:
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.jtransc:jtransc-main:unspecified.
Searched in the following locations:
- https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.pom
- https://plugins.gradle.org/m2/com/jtransc/jtransc-main/unspecified/jtransc-main-unspecified.jar
Required by:
project : > com.jtransc:com.jtransc.gradle.plugin:0.6.8 > gradle.plugin.com.jtransc:jtransc-gradle-plugin:0.6.8
and if I go to those URLs in my browser, it returns a 404.
How can I get the jtransc gradle plugin to work in my project?
No idea why plugins block doesn't work, but the following does the job:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.jtransc:jtransc-gradle-plugin:0.6.8"
}
}
apply plugin: "com.jtransc"
Maybe it's published incorrectly because this gradle.plugin. prefix here seems totally out of place.

Accessing dependency from Remote Server

I've hosted a dependency in my gitlab repository that I'm trying to access in another project. I've provided the path of my repository in the root build.gradle of another project however for some reason the URL that is generated by gradle to fetch the dependency is invalid. I've been trying to figure out what I might be doing wrong but so far I couldn't pin point the problem.
I'm posting the gradle code for generating the aar file and the code which tries to fetch this dependency in another Android app.
Library build.gradle file:
publishing {
publications {
maven(MavenPublication) {
groupId 'com.umer' //You can either define these here or get them from project conf elsewhere
artifactId 'myLibrary'
version project.version
artifact "$buildDir/outputs/aar/myLibrary-release.aar" //aar artifact you want to publish
//generate pom nodes for dependencies
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
//publish to filesystem repo
repositories{
maven {
url "C:\\Users\\Umer\\AndroidStudioProjects\\android\\myLibrary\\artifacts"
}
}
}
App Level build.gradle of Android App:
dependencies {
provided ('com.umer.myLibrary:myLibrary-1.1')
}
Android app root build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
maven {
url 'http:/GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/BRANCH_NAME/artifacts'
credentials {
username = "myUserName"
password = "myPassword"
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.properties of Android App:
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyPort=12345
org.gradle.jvmargs=-Xmx1536m
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=12345
Gradle Sync Error in Android App Project:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.umer.myLibrary:myLibrary-1.1:.
Could not resolve com.umer.myLibrary:myLibrary-1.1:.
Required by:
project :app
> Could not resolve com.umer.myLibrary:myLibrary-1.1:.
> Could not get resource 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
> Could not HEAD 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
> Connect to 127.0.0.1:12345 [/127.0.0.1] failed: Connection refused: connect
> Connection refused: connect
How can I fix it?
PS:
This is the malformed URL generated by Gradle in Android app.
http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom
By looking at the malformed url:
'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'
It looks like you have 2 issues:
1. You need to replace the GIT_LAB_IP_ADDRESS with the real host name / ip. For this you can use double quotes & the $ sign as place holder:
"http://${GIT_LAB_IP_ADDRESS}/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom"
where GIT_LAB_IP_ADDRESS is either loaded from local.properties or defined in build.gradle file.
Looks like you have another // in your url, right before the last part (unless its a typo)
Hope this helps.

gradle 2.0.0 beta 7 missing

I keep getting this error. Any ideas?
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:classpath'.
Could not find com.android.tools.build:gradle:2.0.0-beta7.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0-beta7/gradle-2.0.0-beta7.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0-beta7/gradle-2.0.0-beta7.jar
You are referring maven central for finding android plugin artifacts, android gradle plugin is published at jcenter
add jcenter() to buildscript.repositories block in your root build.gradle file.
It should look like as below:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:X.X.X' // your verison
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

could not resolve all dependencies for configuration X could not find Z required by B > A

I've already solved this but i'm still curious as to why gradle behaves this way.
In my gradle project i have 2 gradle projects, one named app that is configured with the ear plugin and one named core that is deployed in the lib folder of the ear
I was getting the following error when trying to build my gradle project:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':app:earlib'.
> Could not find org.slf4j:slf4j-api:1.7.5.
Required by:
saturn:app:unspecified > saturn:core:unspecified
> Could not find commons-io:commons-io:2.4.
Required by:
saturn:app:unspecified > saturn:core:unspecified
> Could not find org.slf4j:slf4j-log4j12:1.7.5.
Required by:
saturn:app:unspecified > saturn:core:unspecified
> Could not find log4j:log4j:1.2.17.
Required by:
saturn:app:unspecified > saturn:core:unspecified
My app build.gradle file is:
apply plugin: 'ear'
dependencies {
earlib project(":core")
}
and my core build.gradle is:
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.5'
runtime 'org.slf4j:slf4j-log4j12:1.7.5'
runtime 'log4j:log4j:1.2.17'
testCompile 'junit:junit:4.11'
}
Temporary Solution:
I was able to resolve the issue by adding the mavenCentral repository to my app build.gradle like so:
apply plugin: 'ear'
repositories {
mavenCentral()
}
dependencies {
earlib project(':core')
}
HOWEVER I'm still curious as to why the depending project needs to know what repository the core project resolves it's dependencies from. this document on dependency management doesn't seem to have a very good explanation.
When resolving a configuration, Gradle (only) uses the repositories declared in the same project as the configuration. Hence when resolving the ear project's earlib configuration, only the ear project's repositories are taken into account. That's one reason why it's common to declare all repositories under subprojects in the root build script.

Categories

Resources