I am developing an app using the dart language, flutter framework and firebase as database, and using the vscode as the code editor. I was running the application in the chrome(debug) and it was working completely fine. But when i tried to build an apk file of the application it is giving me the error:
e: C:/Users/asus/.gradle/caches/transforms-3/5201e1a13f9a2d5ba11117fa4f48584e/transformed/jetified-activity-1.7.2/jars/classes.jar!/META-INF/activity_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
And at last the apk file is build but when i tried to install it in my android device it shows an empty screen.
I tried to solve the problem by referring solutions from the internet. I updated the version of the
Kotlin in the android level file as:
build.gradle file:
Also i have updated the gradle-wrapper.properties as:
Since the application is running properly in the web(chrome) so there will be no problem in the code still uploading the main.dart file:
2
Answers
You can try versions like this:
This happend to me once, try to change kotlin version inside the build.gradle file:
}
PS: do not forget to do: flutter clean and flutter pub get before you re-build apk.