ckurtm / FabButton

Android Floating ActionButton with a progress indicator ring
774 stars 152 forks source link

Gradle Project Refresh Error (Can't find FabButton library) #34

Closed JimVanG closed 7 years ago

JimVanG commented 7 years ago

Error:

Could not find fabbutton.jar (mbanje.kurt:fabbutton:1.2.2).
  Searched in the following locations:
      https://jcenter.bintray.com/mbanje/kurt/fabbutton/1.2.2/fabbutton-1.2.2.jar

The FabButton library cannot be found. I have jcenter() in my app's build.gradle and I'm using the most recent library version: compile 'mbanje.kurt:fabbutton:1.2.2@aar'

Let me know if you need anymore information, I'd like to use this library in my project. Thank you!

ckurtm commented 7 years ago

please try compile 'mbanje.kurt:fabbutton:1.2.4@aar'. some issues with the previous bintray plugin when uploading to bintray

JimVanG commented 7 years ago

Facing the same issue when using compile 'mbanje.kurt:fabbutton:1.2.4@aar'. I've reverted to compile 'mbanje.kurt:fabbutton:1.2.1'.

I have your FabButton library in a library project, could the @aar cause any issues when included as a dependency in a library project? I'm asking because compile 'mbanje.kurt:fabbutton:1.2.1' (with no @aar) works fine, but any time I try to use the library as an aar it can't be found.

JimVanG commented 7 years ago
Error:A problem occurred configuring project ':demo-app'.
> Could not find fabbutton.jar (mbanje.kurt:fabbutton:1.2.4).
  Searched in the following locations:
      https://jcenter.bintray.com/mbanje/kurt/fabbutton/1.2.4/fabbutton-1.2.4.jar

Receiving this error when using compile 'mbanje.kurt:fabbutton:1.2.4@aar.

Putting https://jcenter.bintray.com/mbanje/kurt/fabbutton/1.2.4/fabbutton-1.2.4.jar into my web browser fails as well. The error on the webpage reads:

{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not find resource"
  } ]
}
ckurtm commented 7 years ago

its an aar, you wont find a jar. have you even tried running the demo app from this project?

JimVanG commented 7 years ago

Yes, I can't even Gradle Sync the demo app. The demo app depends on my library project, my library project depends on fabbutton. It syncs fine with 'mbanje.kurt:fabbutton:1.2.1', but when I use compile 'mbanje.kurt:fabbutton:1.2.4@aar it does not sync/run, and I receive this error:

Error:A problem occurred configuring project ':demo-app'.
> Could not find fabbutton.jar (mbanje.kurt:fabbutton:1.2.4).
  Searched in the following locations:
      https://jcenter.bintray.com/mbanje/kurt/fabbutton/1.2.4/fabbutton-1.2.4.jar

So it appears that the inclusion of the @aar in the dependency declaration is messing things up.

ckurtm commented 7 years ago

please run the demo app from this project independently first. Establish if that does not work at all first before attempting to add your own library module as I cant help without knowing the structure and gradle config of your own project.

What version of the gradle plugin are you using?

JimVanG commented 7 years ago

I've verified that the demoApp and myLibrary build/run fine without the inclusion of compile 'mbanje.kurt:fabbutton:1.2.4@aar. When I add compile 'mbanje.kurt:fabbutton:1.2.4@aar to myLibrary the demoApp is unable to sync because demoApp cannot find fabbutton, I receive this error:

Error:A problem occurred configuring project ':demo-app'.
> Could not find fabbutton.jar (mbanje.kurt:fabbutton:1.2.4).
  Searched in the following locations:
      https://jcenter.bintray.com/mbanje/kurt/fabbutton/1.2.4/fabbutton-1.2.4.jar

myLibrary syncs fine with compile 'mbanje.kurt:fabbutton:1.2.4@aar as a dependency, and I can use the fabbutton api within myLibrary, but once I publishToMavenLocal and sync the demoApp, the demoApp fails to sync because it cannot find fabbutton.

What version of the gradle plugin are you using?

I am using the recommended version: 2.2.3.

My library project is in a -SNAPSHOT state, could this somehow cause an issue?

JimVanG commented 7 years ago

Here are the gradle configurations for my project:

LibProject/build.gradle (top-level build.gradle):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
        mavenCentral()
        maven {
             url "s3://theUrl/release"
            credentials(credentials) {
                accessKey usrname
                secretKey psswrd
            }
        }
        maven {
            url "s3://theUrl/snapshot"
            credentials(credentials) {
                accessKey usrname
                secretKey psswrd
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

myLibrary/build.gradle (the library's builld.gradle):

repositories {
    jcenter()
    mavenCentral()
    mavenLocal()
}

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        mavenLocal()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'net.researchgate:gradle-release:2.4.0'
    }
}

apply plugin: 'maven-publish'
apply plugin: 'com.android.library'
apply plugin: 'net.researchgate.release'

group = 'com.my.package'
description = 'description'

apply plugin: 'com.android.library'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName version
    }
    buildTypes {
        ...
    }

    lintOptions {
        abortOnError false
    }

    dexOptions {
        preDexLibraries = false
    }
}

dependencies {
    ...
    compile('mbanje.kurt:fabbutton:1.2.4@aar')
   ...
}

publishing.publications {
    ...
}

publishing.repositories {
   ...
}

release {
    tagTemplate = 'v${version}'
}

afterReleaseBuild.dependsOn publish

demoApp/build.gradle (the app's build.gradle):

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven {
             url "s3://theUrl/release"
            credentials(credentials) {
                accessKey usrname
                secretKey psswrd
            }
        }
        maven {
            url "s3://theUrl/snapshot"
            credentials(credentials) {
                accessKey usrname
                secretKey psswrd
            }
    }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"

    defaultConfig {
        applicationId "com.package.demoApp"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.0'
//    compile project(':myLibrary') (this will sync successfully, but I can't use in production)
    compile('com.my.package:myLibrary:0.3-SNAPSHOT') (will not sync)
}

It's worth noting that myLibrary is in a -SNAPSHOT state, could this cause an issue?

The issue appears to come from the inclusion of the @aar suffix in the compile('mbanje.kurt:fabbutton:1.2.4@aar') statement. Before the @aar was added to fabbutton's dependency path the library and app ran fine. For example, compile('mbanje.kurt:fabbutton:1.2.1') will sync/build successfully, but compile('mbanje.kurt:fabbutton:1.2.4@aar') will not.