BlurBehind - Failed to find in Android Studio dependencies - android

I'm trying use BlurBehind Lib but I getting a error.
Error:Failed to find: com.faradaj:blur-behind:[LATEST_RELEASE_VERSION]
I added
dependencies {
compile 'com.faradaj:blur-behind:[LATEST_RELEASE_VERSION]'
}
I'm still adapting to the new IDE, and I appreciate any help!

Here is how you properly add this library:
Step one
repositories {
maven {
url "https://jitpack.io"
}
}
Step two
dependencies {
compile 'com.github.faradaj:BlurBehind:1.0.3'
}

Couple of things here.
First of all, this library is not distributed from JCenter or even Maven Central.
That means that you need to build it from source. Feel free to +1 this issue.
Luckily, it's rather straightforward, just follow the github instructions.
Once you done that, you'll need to specify the version instead of [LATEST_RELEASE_VERSION].
At the moment it's 1.0.3.

Related

Failed to resolve github libraries Android gradle

In recent days I'm getting failed to resolve github libraries for so many popular libraries. I know it generally happens when the library is suspended or not available. But i tried it for so many libraries. And getting same result. But doesn't mean every libraries don't work. Some works.
For example..
I tried it for PhotoView..
compile 'com.github.chrisbanes:PhotoView:2.0.0'
In the release page the latest version was 2.0.0
I get same thing for so many other libraries. I think last week I updated the gradle. So is that why I'm getting this problem for some libraries..
Or what can be the problem..
I'm also using all maven urls for all libraries as mentioned in the docs file..
Make sure you added this root build.gradle file (Not your module build.gradle file):
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
FYI
New version has been released, You can try with
compile 'com.github.chrisbanes:PhotoView:2.1.3'
After that, Clean-Rebuild-Run.

Error:Failed to resolve: annotationProcessor

This is the following error I am getting while adding a new gradle dependency to my android project. And this error is not project specific. I am getting the same error if I am adding the plugin in any other android project
Error while adding any third party plugin
I also posted my project app level gradle module screenshot
App level gradle module
I even enabled Annotation Processor in the settings. Still no solution. Please help.
use this in your project gradlefile:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
I had same issue, and problem was I forgot to add;
repositories {
maven { url 'https://jitpack.io' }
}
For those who just downloaded Android studio 3.0 update and got the :
Failed to resolve annotationProcessor
Solution: Disable the annotation processor error check
Simply copy the 'JavaCompileOptions' code block below and paste in the defaultConfig{} block.
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
}
Ref: Disable the annotation processor error check
Well ok, now finally after struggling with this issue with annotationProcessor can't be resolved, I can tell that it is a library issue or configuration issue on your side, since you are using 3rd party plugins.
In case of library issue, it might occur in case some of magic wasn't applied to generate javadoc tasks to include javadocDepts into classpath.
Issue with configuration might be that there are custom annotations, but no custom annotation processor, or you didn't include it in dependencies as annotationProcessor 'package.name:annotationProcessorModule:version'
Anyways, I had to remove custom annotations from my own library to be able to use artifact from jcenter, otherwise I would get
Failed to resolve annotationProcessor
all the time as well, when using my library in other project.
Here's the link to my question and my repository in case it might help you if you are developing those 3rd party plugin yourself:
Can't import AAR library with #IntDef annotations
https://github.com/vulko/AnimatedArcProgressView
First of all try to clean project.
It will give you more information about the error and add the following line in your project build.gradle file.
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
then rebuild the project it should work
In our case our internal artifact server was down so it was indeed failing to resolve.
What I would recommend is running your gradle build from command line and adding the --debug parameters to it. Then you'll see lines like the following that will help you see what is failing to resolve. (Note I cut out a bunch of stuff to keep the log short here.)
[org.gradle.api.internal.artifacts.ivyservice.IvyLoggingAdaper] tried http://repo.jfrog.org/...
...
[org.apache.http.impl.conn.DefaultClientConnection] Sending request: HEAD /artifactory/...
[org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 404 Not Found

How to make it possible to add my Library on GitHub to Android Gradle Files?

I have a project hosted on GitHub at https://github.com/BoardiesITSolutions/NavigationDrawerManager.
I've seen some projects on GitHub state adding it to their gradle file in Android Studio to the dependencies section but this doesn't seem to be working for me.
I have tried compile: 'com.github.boardiesitsolutions.NavigationDrawerManager:+' but it keeps saying it can't find it, I've also tried replacing the + with the version number but no luck, Android Studio keeps saying it can't find it. I've added the repository MavenCentral as well.
Is there something I need to do from GitHub to make it accessible for Gradle?
I don't see it on maven.
You can use this website to use non-mavenized libraries with Gradle.
Just add maven { url "https://jitpack.io" } to repositories section of build.gradle and use compile 'com.github.BoardiesITSolutions:NavigationDrawerManager:0b14c84445' in dependencies.

How does gradle choose certain urls to look in for a repository? How do I point it in the right direction so that I can import this JAR?

In order to fetch the cwac-camera commonsware jar, I have this in build.grade:
dependencies {
compile 'com.commonsware.cwac:camera:0.6.+'
}
when I try and compile, it gives me this:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.commonsware.cwac:camera:0.6.12.
Searched in the following locations:
https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
Required by:
Cwac4:app:unspecified
so its looking in jcenter, and in a bunch of my home directory files and failing to find anything. I think it should look on github as I know there are releases here: https://github.com/commonsguy/cwac-camera/releases, so how can I tell it that?
additionally, when I manually include the jar in one of my home directories for instance, it compiles with no errors, but using import com.commonsware.camera..(anything basically) results in "could not resolve symbol commonsware" errors. I take this to mean that I can't just manually put it somewhere and that perhaps android studio needs to see it in an official repository for it to allow importing it. Is this correct?
NOTE: I know that this library is slated to be rewritten. I would like to use it anyways if possible.
so how can I tell it that?
Quoting the current version of the documentation:
To integrate the core AAR, the Gradle recipe is:
repositories {
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
}
dependencies {
compile 'com.commonsware.cwac:camera:0.6.+'
}
You appear to have added the dependencies but did not update your repositories.
Use this
repositories {
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
maven { url 'https://jitpack.io' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
}

How can I specify the latest commit version in Gradle

I'm using Gradle in my Android project,and I have added some dependencies in build.gradle file.For some reasons,I want to point to the latest commit for one of my dependencies.For example:
dependencies {
...
compile 'com.github.ozodrukh:CircularReveal:1.1.0#aar'
}
I'm specifying CircularReveal's version to be 1.1.0#aar,and I know currently it has fixed some bugs but have not released it yet.How can I specify a commit in Gradle?I know some basics about Cocoapods,and it can be done like this:
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f8319af'
Can it be done in Gradle? Any help would be greatly appreciated.
You can not do this directly from Gradle, but there are Gradle plugins and tools you can use to achieve this.
You can do this using Jitpack, an external tool. All you need to do is specify Jitpack as a repository:
repositories {
maven {
url "https://jitpack.io"
}
// Define your other dependency repositories, if any
}
Then include your dependency:
dependencies {
compile 'com.github.ozodrukh:CircularReveal:25aeca505d'
// Include your other dependencies, if any
}
You can also use use the gradle-git-repo-plugin from Layer, but I haven't tried this one yet. An advantage(?) of this plugin is that it clones the repository on your local machine and adds it as a dependency from there.
Ugo response is probably the correct one, here's an alternative for some specific cases:
dependencies {
...
compile 'com.github.ozodrukh:CircularReveal:1.1.+#aar'
// or 1.+ or even just +
}
That puts you on the latest version, no matter which one it is. Now, if you repository builds on a CI environment and deploys snapshots to Sonatype or a similar service, you can do
repositories {
maven {
url "https://project.sonatype.io"
}
}
And along with the other change you'll end up in the -SNAPSHOT versions. This behaviour reports warnings on build because your builds will not be reproducible, but that's a given if you're targeting CI versions.

Categories

Resources