card-scanner-flutter
card-scanner-flutter copied to clipboard
Card Scanner Issue
I have added the pre release version of Card Scanner like this card_scanner: ^1.0.1-prerelease but the project is not compiling successfully and throws an exception. My flutter version is 2.2.3 and dart version is 2.13.4. The first exception was thrown is related to min sdk version but then I changed the minSdkVersion 21 in android -> app ->src -> builde.gradle & as well as the targetSdkVersion is 30. After that I again tried to run the project but it throws an exception given below.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':card_scanner: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.
-
Get more help at https://help.gradle.org
BUILD FAILED in 49s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
The version details are as followed.
android { compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.card_scanner_demo"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }
buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() }
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Flutter 2.2.3 Dart 2.13.4
Please help me out I've tried everything but no use.
Thanks
I have added the pre release version of Card Scanner like this card_scanner: ^1.0.1-prerelease but the project is not compiling successfully and throws an exception. My flutter version is 2.2.3 and dart version is 2.13.4. The first exception was thrown is related to min sdk version but then I changed the minSdkVersion 21 in android -> app ->src -> builde.gradle & as well as the targetSdkVersion is 30. After that I again tried to run the project but it throws an exception given below.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':card_scanner: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.
- Get more help at https://help.gradle.org
BUILD FAILED in 49s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
The version details are as followed.
android { compileSdkVersion 30
sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.card_scanner_demo" minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName }dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }
buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() }
dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }}
Flutter 2.2.3 Dart 2.13.4
Please help me out I've tried everything but no use.
Thanks I have faced the same issue. I resolved this by upgrading the kotlin version. ext.kotlin_version = '1.4.32'
I have added the pre release version of Card Scanner like this card_scanner: ^1.0.1-prerelease but the project is not compiling successfully and throws an exception. My flutter version is 2.2.3 and dart version is 2.13.4. The first exception was thrown is related to min sdk version but then I changed the minSdkVersion 21 in android -> app ->src -> builde.gradle & as well as the targetSdkVersion is 30. After that I again tried to run the project but it throws an exception given below. FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':card_scanner: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.
- Get more help at https://help.gradle.org
BUILD FAILED in 49s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm) The version details are as followed. android { compileSdkVersion 30
sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.card_scanner_demo" minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName }dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() }
dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }} Flutter 2.2.3 Dart 2.13.4 Please help me out I've tried everything but no use. Thanks I have faced the same issue. I resolved this by upgrading the kotlin version. ext.kotlin_version = '1.4.32'
I tried this but still getting same error even I tried the same ext.kotlin version as well that's used in the github demo project but nothing happened and got the same exception.
C:\src\flutter.pub-cache\hosted\pub.dartlang.org\card_scanner-1.0.1-prerelease\android\src\main\java\com\nateshmbhat\card_scanner\CardScannerCameraActivity.kt: (50, 26): Type mismatch: inferred type is CardScannerOptions? but CardScannerOptions was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\card_scanner-1.0.1-prerelease\android\src\main\java\com\nateshmbhat\card_scanner\scanner_core\models\CardScannerOptions.kt: (27, 44): Type mismatch: inferred type is ArrayList<String!>? but List<String> was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\card_scanner-1.0.1-prerelease\android\src\main\java\com\nateshmbhat\card_scanner\scanner_core\models\CardScannerOptions.kt: (33, 45): Type mismatch: inferred type is ArrayList<String!>? but List<String> was expected
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':card_scanner: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.
-
Get more help at https://help.gradle.org
BUILD FAILED in 1m 43s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
same here, any solution?