4

All day I'm trying to add my Android library to Github with JitPack. I did everything described on: https://jitpack.io/docs/ANDROID/, with no success.

The problem is, when i try to build project, Android Studio give me message:

Error:(47, 13) Failed to resolve: com.github.linean:btleuart:v1.0.0

Here is my repo: https://github.com/linean/btleuart

If anyone have any idea what should I check please tell me.

Sorry for my english :)

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
IlIlIl
  • 115
  • 9
  • Show your gradle file, please – OneCricketeer Nov 23 '16 at 14:03
  • If you mean my app gradle thats not a problem for sure, because it work with sample JitPack library :( https://github.com/jitpack/android-example – IlIlIl Nov 23 '16 at 14:07
  • I think you want `btleuart:1.0.0`. Remove the `v` – OneCricketeer Nov 23 '16 at 14:13
  • Actually, the build failed. Check the logs. I'm not sure just "any project" can just be downloaded by JitPack. https://jitpack.io/com/github/linean/btleuart/v1.0.0/build.log – OneCricketeer Nov 23 '16 at 14:15
  • It still don't work. Version is v1.0.0 for sure https://github.com/linean/btleuart/releases – IlIlIl Nov 23 '16 at 14:15
  • Thanks, how did you get this log :) ? I didn't know about that – IlIlIl Nov 23 '16 at 14:18
  • Went to the root page. https://jitpack.io/ copied your Github link, click logs. On that note, I see your logs say Gradle 2.14.1, but the instructions on the site say "Gradle 3.0 or later" – OneCricketeer Nov 23 '16 at 14:19
  • Yes, but that instruction for JitPack 1.5, and below is link to older version. It says that JitPack 1.4.1 works with gradle 2.14+, so I use 1.4.1. – IlIlIl Nov 23 '16 at 14:21
  • Okay, I see. Have you ran the `./gradlew install` command yourself in the terminal? The logs do say "Task 'install' not found in root project", so that would indicate to me that it shouldn't work locally either – OneCricketeer Nov 23 '16 at 14:25
  • Unfortunately i have, and the result is: BUILD SUCCESSFUL – IlIlIl Nov 23 '16 at 14:32

3 Answers3

3

The release "v1.0.0" does not exist. The release name is "1.0.0". So, in your app or library gradle file, replace

compile 'com.github.linean:btleuart:v1.0.0'

by

compile 'com.github.linean:btleuart:1.0.0'

In addition, make sure that you have included JitPack repo in your root gradle file.

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }
}

You can read some examples describing how to use JitPack to include libraries in your projects

José Carlos
  • 654
  • 6
  • 16
1

I found solution !

  1. Clean project
  2. use /.gradlew build
  3. use /.gradlew install
  4. Compille project
  5. Git - and now its working

Thanks cricket_007 for info about JitPack build log :)

IlIlIl
  • 115
  • 9
0

main build.gradle file should have this:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }
}

you can check a working example here: https://github.com/matoelorriaga/pokemon-mvp/blob/master/build.gradle

Matias Elorriaga
  • 8,880
  • 5
  • 40
  • 58
  • I added it, but still result it's the same. I understand that: main build.gradle in app which loading library should have maven url, it's not correct ? And JitPack example don't have it in their library – IlIlIl Nov 23 '16 at 14:11