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
Related
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.
I have been trying to link the local copy of Android Beacon Library on my computer with my project on Android Studio and I have tried several methods described in this thread How do I add a library project to the Android Studio?
No matter what method I use, I keep getting the error stated in the title. Some threads on Stack Overflow suggest that this is due to submodules within the library and that it could be fixed with "git submodule update --init" but that didn't do anything for me.
As I've said, I tried different methods for adding the library but just for reference, the latest method I did was to add the library to the app/libs/ folder and make the following changes in the code:
settings.gradle: include ':app',':libs:AndroidBeaconLibrary'
build.gradle: added compile project(":libs:AndroidBeaconLibrary") to dependancies.
Ok so I've solved the problem. The issue was that it should have been ':app:libs:AndroidBeaconLibrary' instead of ':libs:AndroidBeaconLibrary' in both gradle files.
This fixed the error but a new one came up:
Error:Cannot cast object '23.0.0' with class 'com.android.repository.Revision' to class 'com.android.sdklib.repository.FullRevision'
I fixed this using this answer https://stackoverflow.com/a/33889117/3001845
I added the lines in the build.gradle file of the library itself under 'buildscript'
The section now looks like this:
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.github.JakeWharton:sdk-manager-plugin:220bf7a88a7072df3ed16dc8466fb144f2817070'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.3'
}
}
I've came across following library
https://github.com/afollestad/material-dialogs
and i have tried to add the dependencies to my project but gradle consistently fails to sync saying that some .aapt file exploded or something
Can some one please guide me on how to add this library correctly and screenshots of how to do it would be great.
Have you add this in build.gradle(Project) (you need to paste this two times - there are two repositoies blocks).
repositories {
maven { url "https://jitpack.io" }
}
And this to other build.gradle(Module:app)
compile('com.github.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
I got a project from a client which I'm supposed to fix. The developer of the app just bailed out and now it's up to me to fix it.
Problem is, that he probably developed with eclipse, while I'm using AndroidStudio. So it wasn't build with gradle. But I managed to import the project and fix it so far, that I can sync gradle.
But he seemed to use an external library, this one: https://github.com/InQBarna/TableFixHeaders
I copied the content of the library folder into my project folder /libraries/tablefixheaders/.
I added include 'libraries:tablefixheaders' to my settings.grade and added compile project('libraries:tablefixheaders') to my dependencies in build.grade.
But if I want to rebuild the project now, I get Error:Configuration with name 'default' not found.. Does the external library have to have a build.gradle? If so, how does it look like? I tried several things but nothing worked for me.
Maybe it's a bit late :)
but I build a wrapper for InqBarna's library ready to use with gradle on this way:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
compile "com.github.miguelbcr:TableFixHeaders-Wrapper:0.1.1"
}
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.