0

I pushed an artifact file to Jcenter via Bintray. The artifact has been published as confirmed by searching the artifact on Jcenter repo. However I am unable to access that artifact in my apps via gradle.

Here is the project repo link: https://bintray.com/alfjam/maven/tickerupdate5/view

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "socket.ingrain.io.sockettest"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.wingoku.tickers:1.0.4'
}

What am I doing wrong? How can I access my artifact files?

Best Regards

user2498079
  • 2,872
  • 8
  • 32
  • 60
  • Can anyone look at my question ? http://stackoverflow.com/questions/30771643/unable-to-find-my-repository-on-jcenter-in-android-studio – Rahul Gupta Jun 11 '15 at 05:17

1 Answers1

2

You are missing the artifact ID. Try:

compile 'com.wingoku.tickers:app:1.0.4'
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Wow it worked. How did you know I had to add ":app" in the ID? – user2498079 Apr 04 '15 at 11:09
  • @user2498079: Well, the fact that you were missing the artifact ID came from looking at your `compile` statement. Bumbling around the JCenter page eventually turned up [the `maven-metadata.xml` file](https://dl.bintray.com/alfjam/maven/com/wingoku/tickers/app/#maven-metadata.xml), which showed that your artifact ID was `app`. – CommonsWare Apr 04 '15 at 11:38
  • I never set an artifactID, so it was set by default. Thanks for the great answer. Once I figure all these things out, I am gonna write a proper detailed tutorial for publishing artifacts to jcenter and maven. Lack of detailed tutorial result in these kinds of confusions. Thanks again – user2498079 Apr 04 '15 at 11:43
  • @user2498079: "I never set an artifactID, so it was set by default" -- I have never uploaded an app as an artifact, only libraries. In the case of libraries, your default artifact ID will be the module name. If your project is a typical Android Studio project, your app's code is in an `app` module. My guess is that is where your artifact ID came from. – CommonsWare Apr 04 '15 at 11:45
  • yep I tried an app project for test publishing. I should have uploaded a library project but on the bright side I wouldn't learnt about this default behavior – user2498079 Apr 04 '15 at 12:12