Your project requires a newer version of the Kotlin Gradle plugin, ext.kotlin_version = '<latest-version>' - flutter

My flutter project doesn't build and throws the following error:
Your project requires a newer version of the Kotlin Gradle plugin.Find
the latest version on
https://kotlinlang.org/docs/gradle.html#plugin-and-versions and then
update the same in android/build.gradle
as ext.kotlin_version=<latest-version>
I have updated build.gradle in android/build.gradle to the following as suggested :
ext.kotlin_version = '1.7.20'
However the error continues to persist. Upon inspecting gradle versions by running
./gradlew --version
I get the following result :
Gradle 7.4.2
------------------------------------------------------------
Build time: 2022-03-31 15:25:29 UTC
Revision: 540473b8118064efcc264694cbcaa4b677f61041
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 18.0.2.1 (Oracle Corporation 18.0.2.1+1-1)
OS: Windows 11 10.0 amd64
Help appreciated.

you should check gradle version
use same version 1.5.31
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'

Related

Could not open settings generic class file error when running flutter application

I am trying to run a new flutter project but then i get this error.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\techj\OneDrive\Desktop\EshopperApplication\eshopper_application\android\settings.gradle' (C:\Users\techj\.gradle\caches\7.4\scripts\ea4ydi90mwjg9g63m7r6nimmx).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63```
I am new to flutter can you please help me out
My gradle version
```------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 19.0.1 (Oracle Corporation 19.0.1+10-21)
OS: Windows 11 10.0 amd64
i was hopping the application would run as intended only to be flagged with this error..Spent a few hours doing some research but then i was hopping the problem would be with my gradle file or version but nothing seems to working for me.

flutter problem, The binary version of its metadata is 1.7.1, expected version is 1.5.1

This is my error I dont understand what is problem,
When i am building apk then i got this error.
How to fix it?
This is my error I dont understand what is problem,
When i am building apk then i got this error.
How to fix it?
This is my error I dont understand what is problem,
When i am building apk then i got this error.
How to fix it?
C:\flutter\bin\flutter.bat --no-color build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_sim_country_code-0.1.2\android\src\main\java\com\example\flutter_sim_country_code\FlutterSimCountryCodePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\google_sign_in_android-5.2.7\android\src\main\java\io\flutter\plugins\googlesignin\GoogleSignInPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Parameter format not correct -
e: D:/Global Lancers/cwc-flutter-app/build/sign_in_with_apple/.transforms/b2c3fc047a9d7267418e111f2de6a0d1/transformed/out/jars/classes.jar!/META-INF/sign_in_with_apple_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/better_player/.transforms/151bfc855fe976bf94ab40ad88e221e1/transformed/out/jars/classes.jar!/META-INF/better_player_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/wakelock/.transforms/8d1905fcae49b140f3094369d4419c90/transformed/out/jars/classes.jar!/META-INF/wakelock_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/audioplayers/.transforms/6631a095458426ecb5445e25a1402e45/transformed/out/jars/classes.jar!/META-INF/audioplayers_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/package_info_plus/.transforms/28be655d06f4aa25e98a201585f1263b/transformed/out/jars/classes.jar!/META-INF/package_info_plus_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/fluttertoast/.transforms/afa6af91d841e4bf71a23b32c52d89d4/transformed/out/jars/classes.jar!/META-INF/fluttertoast_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: D:/Global Lancers/cwc-flutter-app/build/stripe_android/.transforms/2bfe933eebc159364e880a45681bae73/transformed/out/jars/classes.jar!/META-INF/stripe_android_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/transforms-3/b3fa9517f1020cd75f3409be069b61c6/transformed/appcompat-1.5.0/jars/classes.jar!/META-INF/appcompat_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.7.0/362da0b4951ed79a6591743a7fddcfb8c73809f6/kotlin-stdlib-jdk8-1.7.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.7.10/1ef73fee66f45d52c67e2aca12fd945dbe0659bf/kotlin-stdlib-jdk7-1.7.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/transforms-3/00867bb6132ae3ba398fbf21ecff6845/transformed/jetified-core-ktx-1.9.0/jars/classes.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/transforms-3/9f94187b7d0d64c5f03acf766cbb58c7/transformed/core-1.9.0/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/transforms-3/403d294479ff5b9381ca5eb0849050cf/transformed/jetified-annotation-experimental-1.3.0/jars/classes.jar!/META-INF/annotation-experimental_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736acc4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':audioplayers:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:C:\Users\DELL\.gradle\caches\transforms-3\9f94187b7d0d64c5f03acf766cbb58c7\transformed\core-1.9.0\res\values\values.xml:104:5-113:25: AAPT: error: resource android:attr/lStar not found.
* 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 23m 46s
Running Gradle task 'assembleRelease'... 1451.2s
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then │
│ update D:\Global Lancers\cwc-flutter-app\android\build.gradle: │
│ ext.kotlin_version = '<latest-version>' │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
this is my gradleBuilds->
android {
compileSdkVersion 33
kotlinOptions {
jvmTarget = '1.8'
}
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 "org.mycwc"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
--------------------------------
ext.kotlin_version = '1.7.10' // latest version
dependencies {
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Updating ext.kotlin_version to latest version like suggested in all other answers wouldn't fix the error.
When I opened the project in Android studio, it proposed to update gradle and it fixed the error for me.
Now my build.gradle has those lines :
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Flutter pusher_client issue

FAILURE: Build failed with an exception.
What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
project ':flutter_pusher_client' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
This should be resolved in later versions of the client. You should update to version 0.2.1 or above.

Is it possible to use cucumber with gradle buildship in Eclipse?

I'm trying to compile a "hello world" Cucumber application using the Gradle buildship in Eclipse. When I try to run it (choosing 'build') in Eclipse, I get the following error:
Launching gradle tasks failed due to an error connecting to the gradle
build. Could not execute build using gradle distribution
https://services.gradle.org/distributions/gradle-3.5-bin.zip
Some build operations have not been marked as completed
I can successfully build using the command line using the same configuration:
:compileJava
:processResources NO-SOURCE
:classes
:jar
:assemble
:compileTestJava
:processTestResources
:testClasses
:test
skeleton.RunCukesTest STANDARD_OUT
...waiting...
...growling...
1 Scenarios (1 passed)
3 Steps (3 passed)
0m0.085s
:check
:build
BUILD SUCCESSFUL
Total time: 3.19 secs
and here is the version info for the command line:
C:\Users\whalen\Documents\ws\workspace\Cucumber-hello-world>gradlew -version
------------------------------------------------------------
Gradle 3.5
------------------------------------------------------------
Build time: 2017-04-10 13:37:25 UTC
Revision: b762622a185d59ce0cfc9cbc6ab5dd22469e18a6
Groovy: 2.4.10
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Windows 10 10.0 amd64
Any ideas on what might be preventing the build from succeeding on Gradle buildship would be greatly appreciated!

Unable to figure out,No Build tools found

Error:No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Every time i used to gradle sync the project from android studio,I got above error.
Try to change your gradle version in /projectName/build.gradle
classpath 'com.android.tools.build:gradle:x;xxxx'
Then download the new version of the build tools 19.1 and change the following line in /projectName/moduleName/build.gradle
android {
compileSdkVersion 19
buildToolsVersion "19.1" //Set this to 19.1 after SDK update
...
}
Sync your gradle files and it should be working now.