FAILURE: Build failed with an exception. (Flutter) A problem occurred evaluating project ':app' - flutter

I am getting this error when trying to run Flutter on virtual android device. What is the reason? I even reinstalled android studio from scratch. I also did the SDK installs.
I am getting this error message. What is the reason?

Related

Execution failed for task ':image_picker:compileDebugJavaWithJavac' // works on chrome but not on emulator

I need help with my android studio, when I run my project on an emulator it displays the following errors:
Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'.
It happened when I added geolocation to my dependencies
same happened when I added Image_picker to my dependencies
Execution failed for task ':image_picker:compileDebugJavaWithJavac'
i thought it was cause of version but im using latest version
BUT WHEN I RUN IT USING CHROME, IT WORKS PERFECTLY, CAN ANYONE HELP???

Could not find apksig-7.1.3.jar in android studio

I'm trying to sync build.gradle for a flutter app in android studio but it gave this error
this error comes after I tried solving "ssl peer shut down incorrectly" error using the first answer in this question .
I followed all three steps of that solution but without adding the certificates and then I reconverted the steps but I remained with the same error.
Then I was trying to upgrade the gradle but it was interuppted and then the above error occured.

ui.TextLeadingDistribution not found when running Flutter app on chrome or macos

When trying to run my app on chrome or macos after using dart migrate, I get this errors in the console:
Downloading Web SDK... 2,674ms
Launching lib/web/main.dev.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:38:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:98:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:219:3: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? get leadingDistribution =>
It runs fine on the Android / iPhone emulators.
I tried the following but all in vain:
flutter 2.0.6 (stable)
flutter 2.5.3 (stable)
flutter doctor shows nothing wrong
flutter clean, flutter pub cache repair, flutter pub get
Restart VSCode
Actually, the issue was coming from the dependency styled_text.
I copied only the files that we needed from the repo and that solved the issue.

Execution failed for task ':video_player:compileDebugJavaWithJavac'

I am trying to run my flutter project but I can't. I receiving the following error from the console:
Execution failed for task ':video_player:compileDebugJavaWithJavac'. > Compilation failed;
I have tried different versions of the video_player package but it doesn't work.
Please update your android studio.
make sure that you have updated everything in android studio.

Flutter build error. Issue with flutter webview plugin

I have added the flutter webview plugin but its causing problems. Its giving some error when building the project. I tried to delete the cache and rebuild the project but it didn't work.
I just started learning flutter and can't find a solution to this problem.
Below is the error I am getting.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_webview_plugin:compileDebugJavaWithJavac'.
Unable to find source java class: 'C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.0.9+1\android\src\main\java\com\flutter_webview_plugin\WebviewActivity.java' because it does not belong to any of the source dirs: '[C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\main\java, C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\debug\java, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\r\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\buildConfig\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\aidl\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\rs\debug]'
BUILD FAILED in 54s
Finished with error: Gradle build failed: 1
I was using other plugins for firebase auth, firebase analytics, google sign in , webview, ect. Updating all the plugins to the latest version solved the problem.