avast / android-styled-dialogs

Backport of Material dialogs with easy-to-use API based on DialogFragment
Apache License 2.0
2.15k stars 450 forks source link

Cannot build with gradle build system #3

Closed vekexasia closed 11 years ago

vekexasia commented 11 years ago

Hello,

i'm trying to use your library within my project using gradle + your maven group+artifactid.

The first problem I came across is that you're referencing a support library that is different from the "official" one in google repos. This prompts an error

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;

after fixing that by writing the following in my gradle.build:

dependencies {

    compile ('eu.inmite.android.lib:android-styled-dialogs:0.5.7') {
        exclude group: 'com.google.android'
    }

I experienced this other problem below:

Error: duplicate files during packaging of APK /home/abaccega/gitStuff/AppsBuilderProject/AppsBuilder/build/apk/AppsBuilder-ALHHotels-debug-unaligned.apk
    Path in archive: AndroidManifest.xml
davidvavra commented 11 years ago

Can you please try again with the new v1.0? We have done a lot of changes.

vekexasia commented 11 years ago

Hello @destil , unfortunately it seems 1.0 is not in maven central yet.

Do you know when it will become available?

davidvavra commented 11 years ago

We have already pushed it there, it's a matter of hours.

davidvavra commented 11 years ago

It's available in Maven Central now.

vekexasia commented 11 years ago

Still:

Error: duplicate files during packaging of APK 
AppsBuilder/build/apk/AppsBuilder-BIT-debug-unaligned.apk
    Path in archive: AndroidManifest.xml
    Origin 1: AppsBuilder/build/libs/AppsBuilder-BIT-debug.ap_
    Origin 2: /home/veke/.gradle/caches/artifacts-24/filestore/eu.inmite.android.lib/android-styled-dialogs/1.0/apklib/9b3fa453eb57c716e12ff520e08fafaf867a8f75/android-styled-dialogs-1.0.apklib
:AppsBuilder:packageBITDebug FAILED

I suggest publishing it as aar . It looks like it's unusable from gradle

tomas-vondracek commented 11 years ago

@vekexasia agreed, we need to add support for gradle build. If you don't want to wait, pull requests are welcomed :-)

vekexasia commented 11 years ago

Hello tomas, would you mind trying to change the packaging tag of your pom files to "aar" instead of apklib?

That might solve the issue.

Unfortunately I'm very new to maven so I don't have the necessary expertise to even try to fix the problem :(

tomas-vondracek commented 11 years ago

Hi, I can't change packaging type in pom, that would break build for maven users. We need to create new gradle build configuration, it's not about fixing pom. We plan to do that, I just can't tell when we get to it.

vekexasia commented 11 years ago

@tomas-vondracek For my own library (android-form-edittext) i followed this link. http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven

It just worked. I hope that will help you out.

davidvavra commented 11 years ago

Thanks to pull request we were able to add Gradle support. Check version 1.0.1