Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe-Android - Forking and using as own library

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.

like image 273
Advice-Dog Avatar asked Oct 11 '17 17:10

Advice-Dog


1 Answers

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

like image 142
Budius Avatar answered Oct 23 '22 07:10

Budius