0

I'm currently making an e-commerce project using flutter. I need a payment gateway to make transactions, so I install the "stripe_payment" package (https://pub.dev/packages/stripe_payment).

After I followed the installation steps, I run the "flutter run" command. The result is the package stripe can run well in my application.

However, when I run the "flutter build apk", an error appears as below:

enter image description here

The main errors are: e: C:\Users\samue\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-1.0.5\android\src\main\kotlin\de\jonasbark\stripepayment\StripeDialog.kt: (6, 36): Unresolved reference: snackbar

When I open the C:\Users\samue\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-1.0.5\android\src\main\kotlin\de\jonasbark\stripepayment\StripeDialog.kt file and I check line 6, I see inside the file importing import com.google.android.material.snackbar.Snackbar. enter image description here

Then I looked for a solution on google, it looks like the problem is build.gradle. Here I attach the contents of the file from build.gradle

enter image description here

But I tried editing the build.gradle dependencies section that I got from Google, but all of them didn't work. When I run the flutter build apk, the same error still appears.

asked Nov 15, 2019 at 2:30

1 Answer 1

0

I have found the solution. I deleted the package "search_widget", then the package "stripe_payment" can run normally again without any errors during the build.

From this problem, I just understood that there are possibilities that packages on flutter can conflict, causing errors.

answered Nov 17, 2019 at 11:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.