I recently upgrade to flutter 3.19.0 and did the migration guide for the "Deprecated imperative apply of Flutter's Gradle plugins" but now i am getting the following error while trying to run my application on android:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\myuser\Projects\exampleapp\android\build.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'android'.
> Project with path ':app' could not be found in project ':camera_android'.
* 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
I have tried using different combinations of minSdkVersion and compileSdkVersion, currently (24 and 33). Running with verbose options does not give more info:
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'android'.
Caused by: org.gradle.api.UnknownProjectException: Project with path ':app' could not be found in project ':camera_android'.
but nothing seems to work, any solution for this problem?
Try first to upgrade gradually, like the flutter release changes says. If you dont know, try to upgrade to 3.16.0 if not working yet try the other above.
I did that on my project, first upgraded to 3.16.0 then to 3.19.0 with some help from stackoverflow. From here
delete android/settings.gradle , after delete run <flutter create .>, to create new setting.gradle , after that should update "org.jetbrains.kotlin.android" to last version of kotlin
for more information:enter link description here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With