-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.4 Bindings #6
Comments
Thanks for bringing this to my attention. Its probably a good idea for me to keep them relatively up to date so I don't fall too far behind. My biggest pain point is having to manually do the android maven dependency chain. That's the section you see here: . I'll add it to my backlog and probably start working on it in the next few weeks. |
Here is my best stab for you. There is something weird going on with Dagger though since 2.50. I think it's related to them removing an obsolete tag on a method in DoubleCheck
|
@chris-oswald Thanks for doing the leg work. Starting off of yours saved some time. Unfortunately, 3+ cannot be bound right now since it requires Google.Dagger 2.5 but xamarin only has nugets for 2.48.x. I tried including dagger as an embedded jar/aar but then I had duplicate class names because some other nuget has a dependency on Google.Dagger. I'm not sure what to do in the mean time. I do have branches for android-3.5 and ios-3.5. I have verified that ios runs correctly. I cant get past the Dagger error so I don't know if there are any other runtime errors for android. If it is worthwhile to have only one platform out, I can publish iOS. Otherwise, I plan on waiting until I can guarantee it is working for both platforms. |
I got stuck on dagger too... |
Any movement on this as I notice Xamarin has 2.50 for Dagger now? I am really stuck on this and need urgent help @chris-oswald @svaldetero |
I am trying to get 3.7.0 bound. Also, I am using .net 8 and cannot get the 3.5.0 solution file to compile. |
I paused on this since I couldn't get around the Dagger issue for Android. Since Stripe is using a new method that was added in 2.50, there's no way around it. Looking at Maven Central StripeTerminal Core dependencies:
It looks like this line will work now for binding Stripe 3.4.0: @ggbtvs Thanks for informing me of the Xamarin.Google.Dagger update, I was unaware. This is still on my backlog to do, but it's not on my immediate agenda. What feature of Stripe are you using that you need urgent help but can't still use Stripe 3.2.1? |
@svaldetero . Thanks for replying. I am trying to get Stripe Working on Android from the very beginning. I have 3.2.1 working fine on IOS. I am NOT using Maui, but Mvvmcross and native screens (storyboards / Android layout xml files). The issue is I can't even get 3.2.1 working and I've tried updating you code to use .net 8 (Android 34) but I get lot's of either' defined multiple times' errors. I the problem I have its I have never working on creating Android bindings before so I don't really know how to get around any issues I came across. Have you ever been able to get 3.2.1 working on Android ? The branch 3.2.0 if yours is for .net 7. Do you have .net 8 version that works? |
net 7 lib/NuGet package will work with a .Net8 (Maui 8) app, if all other dependencies are resolved. I've been meaning to post on this repo, as I have an internal Stripe.Terminal XForms binding that I recently ported to .Net 7/Maui. This issue with the multiple definitions is complicated, but due to directly including all the native .jar/.aar libs in this NuGet. If some other NuGet package also includes a dependency to the same native lib (.jar/.aar), NuGet isn't able to track it and thus includes 2x versions of the .jar/.aar in the build directory for the java-compile step to use, and it is the Java-compiler detecting 2x definitions from the duplicate native lib that NuGet accidentally included 2x: once from this NuGet, and once from another NuGet. I'll post some more later today... but in the mean time, I started this Open source project to help this situation before I founf this repo. I've just been very busy working to port my main project from XForms -> Maui 8, but would be very interested in trying to see if we can't work together long term to support a single Stripe.Terminal.Net wrapper package. If you're interested, take a look at the packages I've already created, and am using for my private Terminal v2.20.0/2.23.3 wrapper. https://xdevapps.visualstudio.com/Android%20bindings |
@ggbtvs There is probably a dependency mismatch that you're not accounting for on 3.2.1. Every time stripe updates a lib, it usually means they updated a dependency, and thus, all that dependency's children. It's a spider web you have to unravel every time, which is why you don't see us update these on every minor revision. I'm running the last published version here on MAUI |
Thanks so much for your help. I am definitely interesting in working together to support a single Stripe.Terminal.Net wrapper. |
Before I forget, this package is one that I know would cause the duplicate definition issue, if both this package (Envoc.Stripe) and the ImageCropper package were included in a Maui app. This was the issue that kicked off the creation of the independent Android NuGet repos I linked; my application was using the XForms image cropper package, but updating to this one to migrate to Maui exposed the conflict with my private Stripe.Terminal wrapper. https://github.com/jmbowman1107/ImageCropper.Maui It defines a dependency NuGet for Kotlin.Parcelize.Runtime.Maui Which is also embedded in this NuGet. Line 119 in bd6f695
My Terminal v 2.20 NuGet was using the Parcelize package from this repo, but for 2.23, we needed to update, so now we're using the independent package from https://xdevapps.visualstudio.com/Android%20bindings. This issue could be resolved by updating Our current plan to resolve this in our App that uses Stripe.Terminal is to replace |
@jasells Do you have a public line to the repo for the internal Stripe.Terminal XForms binding. I've tried using the nuget from Envoc and in a blank Android .net 8 app, it won't compile, complains about google.gms or something not being installed. If I try to install GooglePlayServices.Base, I then get multiple definitions for Guava etc. |
@ggbtvs I don't run many 3rd party dependencies, so you might have some conflicts with the packages you are referencing. I can help with a few of your errors though. Here are my android imports in my csproj
|
@ggbtvs I'd look at these package refs first... seems unusual:
I haven't looked at the dependencies of those, but I'd expect they have some common dependency that may be getting included 2x due to the different versions? ... otherwise I'd trace down exactly which package that |
I am not using Handoff, but the Stripe Terminal. I attach a zip file with a sample app showing the issue. If there is anything anyone can suggest on how to make this control work 'out of the box' I would be very grateful. This is the compilation error I get /Users/orderport/Projects/StripePOC3/StripePOC3: Error JAVA0000: Error in /Users/orderport/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: |
Sorry for the silence, but I didn't want to reply until I had something tangible. I have created bindings for iOS 3.5.0 and 3.8.1. I have updated the cross-platform abstraction with what I have locally and published it with changes for iOS. I recommend pulling the abstraction (Envoc.StripeTerminal) in locally as debugging / tweaking is too hard when it is a nuget package (that's what I did a while back). I also updated the readme with a few changes that I noticed while updating. Android is still on my todo, but I am dreading that xml file. Whatever magic syntax I had to generate the nuget last time has been lost as I get (mostly) build errors or the rare chance it builds - I get the same runtime error. I'm not going to push code or publish a nuget unless I get a running binding. @ggbtvs asked for a NET8.0 version. I multi-targeted iOS for 7 & 8 so you can choose what you want. |
I was able to do the binding for Android 3.8.0. It requires net8.0-android based on the dependent nuget packages. However, I'm getting a consistent runtime crash 2-5 seconds after my main page loads:
If anyone has any insights into this issue, that would expedite me publishing the nuget package. |
Does 3.8.0 add many new dependencies? I put the error in to chat get to see what it came back with. Here is the response. No idea it you've already tried the same, but I know how frustrating it is when you don't get a response to a question asked. So I thought I would try. The error you're encountering, specifically Possible Causes and Solutions
General Steps to Resolve:
If the problem persists, you may need to investigate further into the specific versions of dependencies and their compatibility with each other, as well as look into the specific requirements of the Stripe Terminal library. Apologies if this does not help. |
If you want to share your code, I don't mind trying to have a look at some things. I finally managed to create my own 3.4.0 binding working (.net8), again I was running into many runtime errors. The main difference between my approach and yours appears to be, I did not use many Maven repository references , choosing instead to use as many of the nuget packages. It's clunky and the code is probably totally shit, but it works, and for me that was the main thing. |
New Packages
Converted AndroidMavenLibrary -> PackageReferenceorg.jetbrains.kotlin:kotlin-parcelize-runtime -> Xamarin.Kotlin.Parcelize.Runtime v2.0.0.1 I already had a nuget reference to @ggbtvs I tried to use as many nugets a possible, but when I first did this, a lot of nugets didn't exist. I did look at @jasells binding packages and I might try to switch to more nugets over AndroidMavenLibrary. |
Check out branch https://github.com/Envoc/envoc-stripe-binding/tree/android-3.8.0 for the current code I'm working with |
Turns out for the
Now I have the runtime error that a class isn't found. Going further down the rabbit hole. |
Something to keep an eye on in .Net9: This is in direct response to a request I made to improve the existing Prototype.Android.MavenBindings that this repo is using. And, I forked that prototype to support .Net7/8 with the feature that was just added to .Net9 here (and I am currently using in my own Stripe.Terminal bindings). |
@svaldetero do you have plans to implement the 3.4 bindings soon? They have taken away the required dependency on NFC, which was lowering my device count.
The text was updated successfully, but these errors were encountered: