Cannot load library from MavenLibs repository - java

I want to use the JNoise library. Here's what I found: https://mavenlibs.com/maven/dependency/de.articdive/jnoise
But when I try
implementation 'de.articdive:jnoise:3.0.2'
in my build.gradle I get an error that the artifact is not found. Maybe I need to connect MavenLibs?
repositories {
mavenCentral()
maven {
url "https://mavenlibs.com/maven"
}
}
It didn't help

Related

Java Dependency Bad Gateway 502 - fi.jasoft.plugin.vaadin 1.0.1 is missing

Inherited a project and am trying to run the build.gradle but the dependency is no long on maven... and I have googled and can't find any other active repos. There's a vaadin-spring 1.0.1 but I don't know if that's the same thing. Any body else run into this issue?
buildscript {
repositories {
//jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1')
}
}
apply plugin: "fi.jasoft.plugin.vaadin"
The error:
Could not get resource 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'.
> Could not HEAD 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'. Received status code 502 from server: Bad Gateway
I tried to do a > build gradle and got the error. I have also tried importing a cache on a teammate that has it working but it does not recognize the cache I have imported by replacing my ~/.gradle with my teammates files
It looks like you've added a dependency on the wrong Maven coordinates.
Looking in the Gradle Plugin Portal I can see that the dependency should be classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// wrong coordinates:
// classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1')
// correct coordinates:
classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")
}
}
The coordinates you had used, fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1, do actually exist in the Gradle Plugin Portal Maven repo, but there's no JAR. Why is this?
The reason for this is that Gradle plugins require a marker artifact, so that Gradle can identify plugins using an ID in the plugins block DSL.
For this reason, I recommend you replace using the buildscript {} block to define plugins, and instead use the new plugins {} block.
plugins {
id "fi.jasoft.plugin.vaadin" version "1.0.1"
}

Could not find org.apache.httpcomponents:httpclient:4.5.6 when adding Firebase Crashlytics

I removed Fabrics Crashlytics to replace it with Firebase Crashlytics.
I followed the steps mentioned here: https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android
I get the error:
Could not find org.apache.httpcomponents:httpclient:4.5.6.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :myProject > com.google.firebase:firebase-crashlytics-gradle:2.1.1 > com.google.firebase:firebase-crashlytics-buildtools:2.1.1
Do you see how to solve this problem?
Thanks.
Google's Maven Repository doesn't track org.apache.httpcomponents. This may work:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.google.firebase:firebase-crashlytics-gradle:2.1.1"
}
}

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 build failed to resolve library

I am working on android (Java) and trying to consume websockets so I thought I would use this tutorial and they are using dependency org.java-websocket:Java-WebSocket:1.3.0 from this repo which has now become 1.3.1.
So I have in my modular build.gradle
dependencies {
...
compile 'org.java-websocket:Java-WebSocket:1.3.1'
...
}
and in my project / top level build.gradle I have
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
and I am getting error
Error:(49, 13) Failed to resolve: org.java-websocket:Java-WebSocket:1.3.1
Try it with lowercase:
compile 'org.java-websocket:java-websocket:1.3.1'
It worked for me.
Edit:
the project level gradle file:
buildscript {
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
}
I was also facing same issue ,I restarted Android Studio and sync again,it build successfully.

Android Maven Could not resolve dependencies for configuration

I'm facing this problem currently. The project did't have any build problems previously. Only today when I was trying to build it gives this error.
Gradle: A problem occurred configuring project ':Project'.
Could not resolve all dependencies for configuration ':Project:classpath'.
Could not download artifact 'org.ow2.asm:asm-analysis:4.0#jar'
Artifact 'org.ow2.asm:asm-analysis:4.0#jar' not found.
Seems like asm-analysis:4.0 is not found in maven repo.
(Is this link correct? http://search.maven.org/#browse%7C1692005229)
Inside my build.gradle file, I've set the repository to mavenCentral()
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
} }
I am not sure how to fix this problem, any suggestion is appreciated.
Thank you.
Faced the same problem, ow2.org has separate repository
buildscript {
repositories {
maven { url "http://repository.ow2.org/nexus/content/repositories/releases/" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

Categories

Resources