Skip to content
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

Cannot build with Version 7.0.0 #1022

Closed
zakblacki opened this issue Nov 15, 2022 · 11 comments · Fixed by #1026
Closed

Cannot build with Version 7.0.0 #1022

zakblacki opened this issue Nov 15, 2022 · 11 comments · Fixed by #1026
Labels
Android Issue related to Android native bindings bug Something isn't working

Comments

@zakblacki
Copy link

Here's log :

`e: C:\flutter.pub-cache\hosted\pub.flutter-io.cn\stripe_android-7.0.0\android\src\main\kotlin\com\reactnativestripesdk\Mappers.kt: (453, 3): 'when' expression must be exhaustive, add necessary 'UpiAwaitNotification' branch or 'else' branch instead
e: C:\flutter.pub-cache\hosted\pub.flutter-io.cn\stripe_android-7.0.0\android\src\main\kotlin\com\reactnativestripesdk\utils\Mappers.kt: (458, 3): 'when' expression must be exhaustive, add necessary 'UpiAwaitNotification' branch or 'else' branch instead

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':stripe_android:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 2m 47s
Exception: Gradle task assembleDebug failed with exit code 1
`

@zakblacki zakblacki added the needs triage Needs triage label Nov 15, 2022
@remonh87
Copy link
Member

I would recommend to run flutter clean first and then run again. Also make sure that you have gradle 7.4 or higher

@remonh87 remonh87 added Awaiting response Awaiting response from the issuer and removed needs triage Needs triage labels Nov 15, 2022
@tamirrab
Copy link

Same here,
Using gradle 7.4
Done flutter clear

@geosebas
Copy link

Same here, first time I tried to use flutter_stripe.
When you say "gradle 7.4", do you guys mean the version of android gradle plugin is 7.4 or gradle version is 7.4 ? Currently using android studio dolphin and it doesn't support 7.4+ android gradle.

Done multiple time flutter clean and flutter pub get too

@geosebas
Copy link

Okay managed to build by reverting to an older kotlin version (1.6.21). Starting with Kotlin 1.7.0, we get theses build errors.

So for me I managed to build with :

  • Kotlin : 1.6.21 (see android/build.gradle)
  • Android gradle plugin : 7.2.2 (see android/build.gradle)
  • Gradle: 7.4 (see android/gradle/wrapper/gradle-wrapper.properties)

PS : I still got an 'note' when building :

Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\stripe_android-7.0.0\android\src\main\kotlin\com\facebook\react\uimanager\DisplayMetricsHolder.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

@jonasbark
Copy link
Member

Thanks for the ticket - Kotlin newer than 1.6.21 is indeed not supported at the moment

@asaarnak
Copy link
Contributor

asaarnak commented Nov 16, 2022

Since July 2022 Kotlin 1.7.10, 1.7.20, 1.7.21 has worked for us.

asaarnak added a commit to asaarnak/flutter_stripe that referenced this issue Nov 16, 2022
asaarnak added a commit to asaarnak/flutter_stripe that referenced this issue Nov 16, 2022
@asaarnak asaarnak mentioned this issue Nov 16, 2022
@asaarnak
Copy link
Contributor

asaarnak commented Nov 16, 2022

Created PR #1024
Using my fork while waiting for fix.

dependency_overrides:
  stripe_android:
    git:
      url: https://github.com/asaarnak/flutter_stripe
      ref: patch-2
      path: packages/stripe_android

@remonh87 remonh87 added bug Something isn't working Android Issue related to Android native bindings and removed Awaiting response Awaiting response from the issuer labels Nov 16, 2022
@remonh87
Copy link
Member

remonh87 commented Nov 16, 2022

I think it is related to stripe/stripe-react-native#1195

Will try to implement and ship a fix tomorrow (quite busy today).

@remonh87
Copy link
Member

fix in stripe android 7.0.1

@zakblacki
Copy link
Author

Please note this is also recurrent with building on ios it doesn't specify why or where

@remonh87
Copy link
Member

@zakblacki if you have problems with ios feel free to open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issue related to Android native bindings bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants