afollestad materialdialogs library gradle sync fail due to exploded aapt file - android

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
}

Related

Android gradle fails to resolve jitpack snapshot build dependency

I had a GitHub project forked and some fixes applied to it. Now would like to use it as dependency in a project of mine. Have followed the instructions provided at jitpack.io but gradle build fails to find it.
build.gradle (all projects)
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
build.gradle (module)
dependencies {
implementation 'com.github.user:repo:e91058a'
}
Have tried calling File->Sync in Android Studio and running gradlew build --refresh-dependencies. Also tried defining dev-SNAPSHOT as the version number instead of commit hash. But it always ends up with Failed to resolve error.
What am I missing here?
Check your repositority on jitpack.io, and verify that the snapshot was actually built. (Enter your repo url, select 'branches', you must see a green icon near your commit sha)
Also if your repository is private, you'd need to add access token in build.gradle (you can find it in ur account setting)

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

Error while trying to build library locally and binding to project: Error:Configuration with name 'default' not found

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'
}
}

Github Project not available on android studio

I forked a project and I made a little modification on https://github.com/oursgris/datetimepicker
How can I make it available in android studio ?
I tryied to add in build.gradle :
dependencies {
compile 'com.github.oursgris.datetimepicker:library:0.0.3'
}
I had an error : Failed to resolve: com.github.oursgris.datetimepicker:library:0.0.3
What did I missed ?
I manage to output aar file but I don't know how to make it available in android studio with a simple dependancy (like other projects)
Regards
You almost got it right. What was missing is that you need to add a repository that stores your 'aar' file. You can do this with JitPack:
repositories {
maven {
url "https://jitpack.io"
}
}
And then add your library as:
dependencies {
compile 'com.github.oursgris:datetimepicker:0.0.3'
}

Android Crashlytics plugin not installing library

When using the Crashlytics plugin in intellij I follow these steps.
Click plugin on toolbar.
Select App
Allow crashlytics to update AndroidManifest.xml as well has my first Activity.
Click "Next"
Try to build the App as the plugin instructs.
Then when i try to build i get this:
package com.crashlytics.android does not exist
I look in my dependencies and library and the jar is nowhere to be found.
What am I missing that would cause the library to not be loaded?
I solved this by following the maven instructions here https://crashlytics.com/downloads/maven and then just grabbing the jar from my .m2 and putting it in my libs folder. (This particular project was started as a maven project, then Maven was discarded and it has not yet been migrated to Gradle, so we're kind of in no-man's land). Anyway, I now have the jar.
The following configuration should work for Gradle-based projects:
buildscript {
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
classpath "com.crashlytics.tools.gradle:crashlytics-gradle:1.+"
}
}
apply plugin: "crashlytics"
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
compile "com.crashlytics.android:crashlytics:1.1.+"
}
Taken from https://crashlytics.com/downloads/gradle
After the automated setup from android studio, I was missing this line:
compile 'com.crashlytics.android:crashlytics:1.1.+'

Categories

Resources