Android dependency not working - android

I'm trying to use the binance Java API. When I add:
Implementation: 'com. binance.api: binance-api-client: 1.0.0'
to the dependendencies and sync it, I get an error saying
Failed to resolve: com.binance.api:binance-api-client:1.0.0
I also tried the following:
Implementation: 'com. binance.api: binance-api-client:+'
which didn't work either.
What am I doing wrong and how can I fix it?

Unfortunately, the github owner didn't create a maven release yet. So, you need to depends on jitpack.io.
Modify your root build.gradle to contains maven jitpack.io like this:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
then add the dependency:
implementation 'com.github.binance-exchange:binance-java-api:69f56f5fcf'
You can take a look at https://jitpack.io/#binance-exchange/binance-java-api

Related

Android Studio: Unresolved reference despite Gradle sync successful after adding third party implementation. Works fine with previous version

I am trying to add this library:
https://github.com/blipinsk/ViewPropertyObjectAnimator
I have added this to my build.gradle file's dependencies:
implementation 'com.bartoszlipinski:viewpropertyobjectanimator:1.5.0'
The Gradle sync is successful after this too.
However when I try to use it:
ViewPropertyObjectAnimator.animate(this#CustomToolbar).topMargin(it).setDuration(200).start()
It keeps telling me Unresolved reference: ViewPropertyObjectAnimator. And I am unable to import as the com.bartoszlipinski doesn't exist when importing.
If I change the library version from 1.5.0 to 1.4.5:
implementation 'com.bartoszlipinski:viewpropertyobjectanimator:1.4.5'
it works fine and import works fine too.
I would prefer using the newer version instead of the old one. Where am I going wrong?
EDIT: I just noticed that even though Gradle sync is successful, it logs a warning:
Failed to resolve: com.bartoszlipinski:viewpropertyobjectanimator:1.5.0 Show in Project Structure dialog Affected Modules: app
And with the older version, I can see the library in the Android Studio's "External Libraries" but it's not there in the newer library version:
Edit 2: I think I figured it out. I came across this:
https://github.com/blipinsk/ViewPropertyObjectAnimator/issues/16
Using custom bintray repo is a bit unusual, and mavenCentral only has up to 1.4.5. Any chance of updating to 1.5.0 on mavenCentral too? Just curious, but technically bintray works well for me atm too
So it seems like mavenCentral doesn't have the updated version.
I recently came across this issue, I added jitpack repository to the settings.gradle file instead of the root file.
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
Implementation in the build.gradle file was the same.
implementation 'com.github.blipinsk:ViewPropertyObjectAnimator:1.5.0'
I was able to figure this out. I came across this:
https://github.com/blipinsk/ViewPropertyObjectAnimator/issues/16
Using custom bintray repo is a bit unusual, and mavenCentral only has up to 1.4.5. Any chance of updating to 1.5.0 on mavenCentral too? Just curious, but technically bintray works well for me atm too
So it seems like mavenCentral doesn't have the updated version. As a workaround, I added
maven { url "https://jitpack.io" }
to
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
and then change the dependency to:
implementation 'com.github.blipinsk:ViewPropertyObjectAnimator:1.5.0'

getting failed to resolve when adding dependency

I am trying to add an external dependency from jcenter
compile 'com.droidninja:filepicker:2.0.4'
but I keep getting these errors and I can't figure out what is going wrong.
I have seen the same errors come up in lot of projects but nobody seems to know whats going wrong.
The problem is not with the dependency you just added but the Android Support library's dependencies. The latest SDK updates move towards using the remote Google Maven repository instead of downloading everything to be available locally. In order to fix dependency resolution problems follow the Adding Support Libraries guide. Really briefly this is what you have to do:
Open your project's build.gradle (note that this is not the module's file!)
Add the Google Maven repo to the project repositories:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
It's also recommended to add the repo to the buildscript block too, so later on the Gradle plugins can be downloaded from there too:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}

Unable to use JitPack repository - Android

All day I'm trying to add my Android library to Github with JitPack.
I did everything described on: https://jitpack.io/docs/ANDROID/, with no success.
The problem is, when i try to build project, Android Studio give me message:
Error:(47, 13) Failed to resolve: com.github.linean:btleuart:v1.0.0
Here is my repo: https://github.com/linean/btleuart
If anyone have any idea what should I check please tell me.
Sorry for my english :)
The release "v1.0.0" does not exist. The release name is "1.0.0". So, in your app or library gradle file, replace
compile 'com.github.linean:btleuart:v1.0.0'
by
compile 'com.github.linean:btleuart:1.0.0'
In addition, make sure that you have included JitPack repo in your root gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
You can read some examples describing how to use JitPack to include libraries in your projects
I found solution !
Clean project
use /.gradlew build
use /.gradlew install
Compille project
Git - and now its working
Thanks cricket_007 for info about JitPack build log :)
main build.gradle file should have this:
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
you can check a working example here: https://github.com/matoelorriaga/pokemon-mvp/blob/master/build.gradle

Failed to resolve: com.osbcp.cssparser:cssparser:1.5 HtmlSpanner-NightWhistler

I integrated HtmlSpanner into my Android application. I'm getting the following error:
Failed to resolve: com.osbcp.cssparser:cssparser:1.5.
How do I solve this error?
Thanks for help
This library is not in the standard Maven repository, that Gradle uses to resolve dependencies.
You should add the following repository address to your build.gradle file:
repositories {
mavenCentral()
maven {
url "http://repo.pageturner-reader.org"
}
}
If somebody is still looking, this lib or its analogue is in
maven repo
So you can just add dependency to build.gradle:
implementation 'com.osbcp:cssparser:1.7'
If you also need HTMLCleaner dependency, you can also find it in the standard repo
And add as a dependency to build.gradle like this:
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.26'

Host library project for others to use as dependency in their projects

I want to make android dependencies path of my project. For, example I made one library demo for AnimatedTextView now I want to use that demo in my other project as compile path like this.
dependencies {
compile 'com.zerocool.animatedtextdemo:AnimatedTextView:1.0'
}
I don't know how to make this path. If some one want to use my this library then I don't need to give demo library. Just give this compile path so they can use this. I don't have any idea for this.So suggest me what I have to do...?
To make this work, you need your library in a repository that is identified in the buildscript like this:
buildscript {
repositories {
mavenCentral()
jcenter()
}
}
This creates a reference to a repository where you can put external dependencies. See the documentation here: https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html
For example, if you want to host your own repository, you can create a maven server, add your library and then put this in the gradle.build:
buildscript {
repositories {
maven {
url "http://repo.mycompany.com/maven2"
}
mavenCentral()
jcenter()
}
}
If you then put your library in the repo at http://repo.mycompany.com/maven2, gradle will check that repo when it tries to resolve dependencies and it should find your library.
Note that you can reference multiple repository locations, and some are "well known" so you do not have to specify the URL. There are many ways to "host" your repo, but that is how you allow for the type of behavior that you asked about. See this reference here: https://docs.gradle.org/current/userguide/dependency_management.html#sec:repositories

Categories

Resources