7

I'm integrating stripe-android into my application, but needed a few changes to make it fit correctly. Following this answer, I made a fork and include it as a gradle dependancy.

Linked Answer

You can use another way to add a dependency with a github project,using the github repo and the jitpack plugin In this case you have to add this repo tp your build.gradle

repositories {
     // ...  
     maven { url "https://jitpack.io" }
 } 

and the dependency:

dependencies {         
    compile 'com.github.User:Repo:Tag'
}

Implementing

Sounds easy enough. So I created a fork, and made the small changes I need, and created a new tag following their scheme, v5.1.1. I then added it to my dependencies.

dependencies {         
    compile 'com.github.ClickDishes:stripe-android:v5.1.1'
}

So it's able to find a version; however, it will now give me an error.

Error: Module 'com.github.ClickDishes:stripe-android:v5.1.1' depends on one or more Android Libraries but is a jar

You can find my tag here, https://github.com/ClickDishes/stripe-android/releases/tag/v5.1.1

Any idea on what I'm doing wrong?

Thanks.

Update

I've been looking into this more and I think it may be an issue with the setup of the library. Reading the logs on JitPack shows a lot of errors regarding Android support classes, and gms. So I believe it's not playing nice with some libraries.

https://jitpack.io/com/github/ClickDishes/stripe-android/v5.1.1/build.log

  ... 
  symbol:   class LineItem
  location: class CartError
/home/jitpack/build/android-pay/src/main/java/com/stripe/wrap/pay/utils/CartManager.java:9: error: package com.google.android.gms.wallet does not exist
import com.google.android.gms.wallet.Cart;
                                    ^
  ...

And then I compared to the actual stripe:stripe-android library on JitPack, and the same errors show up.

advice
  • 5,778
  • 10
  • 33
  • 60

1 Answers1

1

I looked up your repo, you included (they included?) the actual letter v on the version, so it's like this:

dependencies {         
   compile 'com.github.ClickDishes:stripe-android:v5.1.1'
}

you can see it here: https://jitpack.io/#ClickDishes/stripe-android/v5.1.1

Budius
  • 39,391
  • 16
  • 102
  • 144
  • I'm trying that right now, but when syncing, it's stuck downloading. Has been "downloading" `v5.1.1` but it's been on that for 15mins+. Any idea? – advice Oct 11 '17 at 18:18
  • Jitpack servers are running slow, try again tomorrow?!? Just guessing, Sorry – Budius Oct 11 '17 at 19:41
  • Alright, I'll keep trying. I left it running and still nothing after an hour. – advice Oct 11 '17 at 20:02
  • I emailed JitPack about the slow downloading, and they said they fixed it. However, I'm still getting the issue where it says it depends on libraries, but is a jar. – advice Oct 12 '17 at 20:04