Cannott build the app on Android Studio

Troubleshooting

I am try 2 days to compile the app on android studio on Mac m2.
and i get error on the build bellow.
Any help ?


e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt: (946, 20): Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

The class is loaded from /Users/ioannis/.gradle/caches/transforms-3/79747132ac192bc4e31406cdd393649a/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt: (947, 7): Unresolved reference: to

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt: (947, 10): Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

The class is loaded from /Users/ioannis/.gradle/caches/transforms-3/79747132ac192bc4e31406cdd393649a/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt: (947, 20): Class 'com.stripe.android.model.CardBrand' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

The class is loaded from /Users/ioannis/.gradle/caches/transforms-3/79747132ac192bc4e31406cdd393649a/transformed/jetified-payments-model-20.37.4-api.jar!/com/stripe/android/model/CardBrand.class

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt: (951, 20): Unresolved reference: it

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/PostalCodeUtilities.kt: (8, 14): Unresolved reference: isWhitespace

e: /Users/ioannis/.pub-cache/hosted/pub.dev/stripe_android-10.1.1/android/src/main/kotlin/com/reactnativestripesdk/utils/PostalCodeUtilities.kt: (14, 14): Unresolved reference: isWhitespace

FAILURE: Build 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 9s

Running Gradle task 'assembleDebug'... 141.1s

โ”Œโ”€ Flutter Fix

โ”‚ [!] Your project requires a newer version of the Kotlin Gradle plugin. โ”‚

โ”‚ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update /Users/ioannis/Documents/GitHub/pronet/android/build.gradle: โ”‚

โ”‚ ext.kotlin_version = '<latest-version>'

Error: Gradle task assembleDebug failed with exit code 1


What have you tried so far?

build.gradle

// This section defines the Kotlin version and Gradle plugin used throughout the project
buildscript {
    ext.kotlin_version = '1.9.23' //changed to all versions version 

    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // Include the Android Gradle plugin (if not already included)
        classpath 'com.android.tools.build:gradle:7.0.4' // Use the compatible version as per your project requirements

    }
}

// This section is for all projects and sub-projects to find dependencies
allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}


Did you check FlutterFlow's Documentation for this topic?
No
1
2 replies