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 flutter stripe in my project #1103

Closed
10terabyte opened this issue Feb 2, 2023 · 24 comments
Closed

Cannot build flutter stripe in my project #1103

10terabyte opened this issue Feb 2, 2023 · 24 comments
Labels
needs triage Needs triage

Comments

@10terabyte
Copy link

I followed everything to install this library, but I've got this error when build & run project.

e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (53, 26): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (54, 34): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (55, 35): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (56, 23): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (58, 72): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (64, 65): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (57, 26): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (58, 34): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (59, 35): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (60, 23): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (62, 52): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (73, 45): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (84, 18): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (85, 26): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (86, 27): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (87, 15): Unresolved reference: getValOr

FAILURE: Build failed with an exception.

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

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.

BUILD FAILED in 48s
Exception: Gradle task assembleDebug failed with exit code 1

@10terabyte 10terabyte added the needs triage Needs triage label Feb 2, 2023
@10terabyte
Copy link
Author

minSdkVersion 21
ext.kotlin_version = '1.6.10'

import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {
}

<style name="NormalTheme" parent="Theme.MaterialComponents"> ?android:colorBackground </style>

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Followed everything, but what is issue?

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

did you run flutter clean before?

@10terabyte
Copy link
Author

10terabyte commented Feb 2, 2023 via email

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

I added 8.0 to my project and have the same config as you and it did build without problems. Maybe ./gradlew clean will help .

I use grade-wrapper: https\://services.gradle.org/distributions/gradle-7.4-all.zip

@10terabyte
Copy link
Author

I use same gradle wrapper too.
I will try to clean gradlew and try again.

@10terabyte
Copy link
Author

I got this error message when run ./gradlew clean in android folder.

penJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000604400000, 532676608, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 532676608 bytes for Failed to commit area from 0x0000000604400000 to 0x0000000624000000 of length 532676608.

An error report file with more information is saved as:

F:\BaTransfer\ba_transfer_customer\android\hs_err_pid32280.log

but when I run this command in another kotlin project, it is works.
do you know what is issue?

@10terabyte
Copy link
Author

I did "./gradlew clean" after restart pc.
but same error.

e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (53, 26): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (54, 34): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (55, 35): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (56, 23): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (58, 72): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardFormPlatformView.kt: (64, 65): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (57, 26): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (58, 34): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (59, 35): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (60, 23): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (62, 52): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\flutter\stripe\StripeSdkCardPlatformView.kt: (73, 45): Unresolved reference: it
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (84, 18): Unresolved reference: getValOr
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (85, 26): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (86, 27): Unresolved reference: getIntOrNull
e: F:\Android\flutter.pub-cache\hosted\pub.dartlang.org\stripe_android-8.0.0\android\src\main\kotlin\com\reactnativestripesdk\CardFieldViewManager.kt: (87, 15): Unresolved reference: getValOr

@10terabyte
Copy link
Author

FAILURE: Build failed with an exception.

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

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.

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

do you have added a stripe dependency in build.gradle?

@10terabyte
Copy link
Author

no , I did not.

@10terabyte
Copy link
Author

I did not see about that in document.
Please let me know how to add it.

@asaarnak
Copy link
Contributor

asaarnak commented Feb 2, 2023

Same error for me after updating to flutter_stripe 8.0.0+1.

e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:53:26 Unresolved reference: getValOr
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:54:34 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:55:35 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:56:23 Unresolved reference: getValOr
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:58:72 Unresolved reference: it
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt:64:65 Unresolved reference: it
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:57:26 Unresolved reference: getValOr
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:58:34 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:59:35 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:60:23 Unresolved reference: getValOr
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:62:52 Unresolved reference: it
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt:73:45 Unresolved reference: it
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt:84:18 Unresolved reference: getValOr
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt:85:26 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt:86:27 Unresolved reference: getIntOrNull
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-8.0.0/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt:87:15 Unresolved reference: getValOr

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':stripe_android:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

@10terabyte
Copy link
Author

it is worked when you use previous version?
If yes, please let me know which version did you use before.
I will use it for now.

@asaarnak
Copy link
Contributor

asaarnak commented Feb 2, 2023

Yes, 7.0.0 worked.

@10terabyte
Copy link
Author

do you have added a stripe dependency in build.gradle?

I added this line in dependencies of build.gradle.
implementation 'com.stripe:stripe-android:20.19.1'
Bug same error yet.

@asaarnak
Copy link
Contributor

asaarnak commented Feb 2, 2023

I just updated flutter_stripe version from 7.0.0 to 8.0.0+1, no other changes.

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

can you try to build the example app of this repo and see if the issue persist? else I need to have a reproduction repo to properly debug it

@10terabyte
Copy link
Author

I've changed 8.0.0+1 to 7.0.0.
I built project.
but it crashed when create payment intent.

@10terabyte
Copy link
Author

PS F:\Stripe Flutter\example> flutter pub get
Warning: pubspec.yaml has overrides from pubspec_overrides.yaml
Because stripe_example depends on stripe_js from path which doesn't exist (could not find package stripe_js at "..\packages\stripe_js"), version solving failed.
Running "flutter pub get" in example...
pub get failed (66; Because stripe_example depends on stripe_js from path which doesn't exist (could not find package stripe_js at "..\packages\stripe_js"), version solving failed.)
PS F:\Stripe Flutter\example>

@asaarnak
Copy link
Contributor

asaarnak commented Feb 2, 2023

@remonh87
Ok, i'll try to investigate this futher and maybe create a PR.
I think it's the same issue again that was in 7.0.0 also.
When we upgraded to 7.0.0 there was also compiler error because of kotlin version.
Here is the old compiler issue when 7.0.0 was released: #1022

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

How did you solve it?

It is really annoying (especially it outside our control) I will try to contact Stripe if they can help mitigating this in future

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

hmm I can reproduce it as well now will look into it

@remonh87
Copy link
Member

remonh87 commented Feb 2, 2023

Fixed in stripe_android 8.0.0+1

@asaarnak
Copy link
Contributor

asaarnak commented Mar 9, 2023

@remonh87 Similar issue in 9.0.0:

e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-9.0.0/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt:808:14 Expression 'size' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found
e: file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dev/stripe_android-9.0.0/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt:809:127 Expression 'size' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs triage
Projects
None yet
Development

No branches or pull requests

3 participants