cant run the flutter apps on android studio - flutter

i'm going to learn flutter.
so i installed the latest version of flutter(Flutter 3.3.8) and make the path of that on windows.
then i installed the latest version of android studio(Android Studio Dolphin | 2021.3.1 Patch 1) and installed the flutter plugin and sdk and emulator of api 32 and 29 on it.
also i installed the java jdk and jre v8.
but when i try to run the defult app on emulator in recevied this error on terminal :
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:7.1.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom
Required by:
project :
and here it is the result of doctor command of flutter :
C:\Users\new>flutter doctor -v
[√] Flutter (Channel stable, 3.3.8, on Microsoft Windows [Version 10.0.18363.535], locale en-US)
• Flutter version 3.3.8 on channel stable at E:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (9 days ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\new\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: E:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.3)
• Android Studio at E:\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[√] VS Code, 64-bit edition (version 1.71.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18363.535]
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.107
[√] HTTP Host Availability
• All required HTTP hosts are available
I would be grateful if you could guide me in solving this problem.
thx to all!
build.gradle codes

Add google() to your repositories(buildscript and allprojects sections) of app level build.gradle file. The Android Gradle plugin is located there: your_project_folder/android/build.gradle
buildscript {
...
repositories {
google()
mavenCentral()
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}

after some days and try many ways to solve this problem!
found the right solution :
proxy setting was my problem and config that with new proxy settings solve that problem!
thanks everyone.
solved!

Related

**flutter_blue_plus** This version of %1 is not compatible with the version of >Windows you're running. What should I do?

So this project of mine had flutter_blue plugin in it. And I just switched to flutter_blue_plus. And now I can't run it on my system. And this is the error it shows. And when I checked, it feels like no one else is facing this issue. There's no mention on the flutter_blue_plus package issue list either. And i found some of the similar kind of problems on stackOverflow from years ago. And it seems like they're just android problems. And I'm not an android developer. Another known flutter developer faced the same issue with the original flutter_blue package on M1 pro. And on his device, flutter_blue_plus runs properly. I'm using Windows 11 for my development.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_blue_plus:generateDebugProto'.
java.io.IOException: Cannot run program "E:\Dev\Gradle\caches\modules-2\files->2.1\com.google.protobuf\protoc\3.18.0\61d7f5d8849eb1c9b86ff07ca3f6172ce904ed4\protoc-3.18.0-osx->x86_64.exe": CreateProcess error=216, This version of %1 is not compatible with the version of >Windows you're running. Check your computer's system information and then contact the software >publisher
I've tried the basic steps, like cleaning and rebuilding project. And here is the device speceficaiton im using.
flutter doctor -v.
[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [Version 10.0.22623.1245], locale en-US)
• Flutter version 3.7.0 on channel stable at C:\SDK_FILES\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b06b8b2710 (6 days ago), 2023-01-23 16:55:55 -0800
• Engine revision b24591ed32
• Dart version 2.19.0
• DevTools version 2.20.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at C:\SDK_FILES\Android_Studio_Components
• Platform android-33, build-tools 33.0.1
• ANDROID_HOME = C:\SDK_FILES\Android_Studio_Components
• Java binary at: C:\SDK_FILES\Android\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32825.248
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2022.1)
• Android Studio at C:\SDK_FILES\Android
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
[√] VS Code (version 1.74.3)
• VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.58.0
[√] Connected device (4 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22623.1245]
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.120
• Edge (web) • edge • web-javascript • Microsoft Edge 109.0.1518.61
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
If someone is facing this problem. Or anything that looks familiar to it. You can try checking your gradle.properties file inside your projects android folder. And if there's any line that looks like this
protoc_platform=osx-x86_64
Try removing it.
To my little bit of understanding it's just saying the gradle system to look for the macOs operating system while creating the protoc buffer. And it's not finding it bcz the platform is windows. At least in my case, it was. It can be vice versa.

Unable to find bundled Java version?

In the Windows 11 environment, I used scoop to install flutter. Finally, I found the following problem. I tried all the solutions to similar problems on the Internet, but it didn’t work. It’s still the same error:
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on Microsoft Windows [版本 10.0.22000.1219], locale zh-CN)
• Flutter version 3.3.8 on channel stable at D:\Program_Files\scoop\apps\flutter\current
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (2 weeks ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at D:\Program_Files\scoop\apps\android-sdk\current
• Platform android-TiramisuPrivacySandbox, build-tools 33.0.1
• ANDROID_HOME = D:\Program_Files\scoop\apps\android-sdk\current
• Java binary at: D:\Program_Files\scoop\apps\openjdk17\current\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.2+8-86)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
• Visual Studio at D:\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33110.190
• Windows 10 SDK version 10.0.22000.0
[!] Android Studio (version 2022.2)
• Android Studio at D:\Program_Files\scoop\apps\android-studio-canary\current
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
• IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA 2021.2
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is 127.0.0.1;localhost;::1
• NO_PROXY contains localhost
• NO_PROXY contains ::1
• NO_PROXY contains 127.0.0.1
[✓] Connected device (2 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.22000.1219]
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.107
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
How to solve it in my environment
If you are a mac user -
Go to finder and find Android studio:
right click and click show package contents
Create a new folder called jre
copy the contents of the jbr folder and paste them into jre folder
reload your terminal and type flutter doctor
This solution is from #roufy235 and I'm a mac user and this worked for me. Thanks a lot #roufy235.
#roufy235's solution - https://github.com/flutter/flutter/issues/118502#issuecomment-1383215722
If you are a Windows user -
GO TO - C:\Program Files\Android\Android Studio
Then copy the content of jbr and paste the content into jre folder
run flutter doctor again and problem solved
This solution is from #1888ael. Thanks a lot #1888ael.
#1888ael's solution - https://github.com/flutter/flutter/issues/118502#issuecomment-1383219790
For anyone coming here after updating Android Studio to 2022.1 Eel, here is what works for me
Open Windows Powershell (I open from windows start icon right-click > terminal (admin)
Change directory to Android Studio, for example
cd '..\..\Program Files\Android\Android Studio\'
Create a symbolic link for "jre" with "jbr", type the following
New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr
Thanks to timbophillips for this solution
go to C:\Program Files\Android\Android Studio\jbr
copy all files
now go to C:\Program Files\Android\Android Studio\jre
and paste
thats all

How to fix app crash issue with Flutter in_app_purchse 3.0.7 and Billing 5.0.0?

I'm working on migrating Google Play Billing to 5.0.0 by using Flutter in_app_purchase 3.0.7 as I raised the question here. Migrate to Billing 5.0.0
It seems that Play Console still raises warning with in_app_purchase 3.0.7. The workaround is to add com.google.android.play.billingclient.version in AndroidManifest.xml as mentioned here link. When I did that, it got rid of the warning but unfortunately it causes App crashes with following error:
E/AndroidRuntime( 9885): java.lang.NoSuchMethodError: No virtual method setReplaceSkusProrationMode(I)Lcom/android/billingclient/api/BillingFlowParams$Builder; in class Lcom/android/billingclient/api/BillingFlowParams$Builder; or its super classes (declaration of 'com.android.billingclient.api.BillingFlowParams$Builder' appears in /data/app/~~T2Kh46nWychg2xWUZiO5EA==/com.blueedgez.paintover-IPoCtqgP0Ez5df07rfzPyw==/base.apk!classes2.dex)
E/AndroidRuntime( 9885): at io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.launchBillingFlow(MethodCallHandlerImpl.java
I tried with Billing version 4.0.0 but got the same error.
I cleaned all the cache before I executed the build and this is what flutter doctor looks like.
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.18363.592], locale en-US)
• Flutter version 3.3.4 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86ee27 (6 days ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\Jay\AppData\Local\Android\sdk
• Platform android-33, build-tools 32.0.0
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32516.85
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++"
workload, and include these components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio2
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] Android Studio (version 4.1)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.64.2)
• VS Code at C:\Users\Jay\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.17.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18363.592]
• Chrome (web) • chrome • web-javascript • Google Chrome 106.0.5249.103
• Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.70 (unsupported)
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Appreciate any feedback.

Unable to run flutter for Desktop, but can build flutter for desktop (Linux)

My flutter app builds and runs just fine, but I cannot run it in debug mode.
Below is the error I get:
Unable to start executable "build/linux/x64/debug/bundle/polls": ProcessException: Failed to find "build/linux/x64/debug/bundle/polls" in the search path.
Command: build/linux/x64/debug/bundle/polls
ProcessException: Failed to find "build/linux/x64/debug/bundle/polls" in the search path.
Command: build/linux/x64/debug/bundle/polls
The app name I am working on is called polls, and when I look into the directories, the build/linux/x64/release directory has a directory called bundle with the compiled binary, but the build/linux/x64/debug doesn't have the bundle directory.
How do I make flutter run -d linux create the missing directory when compiling the debug version?
My environment configurations are as shown below:
[✓] Flutter (Channel stable, 3.0.1, on Linux Mint 20.3 5.4.0-110-generic, locale en_GB.UTF-8)
• Flutter version 3.0.1 at /usr/local/src/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fb57da5f94 (11 days ago), 2022-05-19 15:50:29 -0700
• Engine revision caaafc5604
• Dart version 2.17.1
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /home/arthur/Android/Sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /usr/local/src/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2021.1)
• Android Studio at /usr/local/src/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin version 211.7817
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.67.2)
• VS Code at /usr/share/code
• Flutter extension version 3.40.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Linux Mint 20.3 5.4.0-110-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.61
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
I just ran into a similar issue, where a sample flutter app, that I created via Visual Studio Code, was unable to find bundle in the path.
As a test, in a completely different directory, from a terminal outside of
Visual Studio Code, I ran flutter create startup_namer and was able to
successfully invoke flutter run -d linux on it.
I solved by running flutter clean

Flutter 2: Run app: Execution failed for task ':location:compileDebugKotlin'

I am trying to build my app but I have encountered a problem that I do not success to resolve. I've tried many stackoverflow solution without any success (like this one Execution failed for task ':location:compileDebugKotlin').
Here the building error:
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
e: C:\Users\Da2ny\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.3.0\android\src\main\java\com\lyokone\location\FlutterLocationService.kt: (124, 1): Class 'FlutterLocationService' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: C:\Users\Da2ny\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.3.0\android\src\main\java\com\lyokone\location\FlutterLocationService.kt: (258, 5): 'onRequestPermissionsResult' overrides nothing
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':location: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 6s
Here my flutter doctor:
C:\lib\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel beta, 2.13.0-0.1.pre, on Microsoft Windows [Version 10.0.22000.613], locale fr-FR)
• Flutter version 2.13.0-0.1.pre at C:\lib\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 13a2fb10b8 (5 days ago), 2022-04-12 15:34:25 -0500
• Engine revision 499984f99c
• Dart version 2.17.0 (build 2.17.0-266.1.beta)
• DevTools version 2.12.1
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\lib\flutter-android
• Platform android-32, build-tools 32.0.0
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32407.343
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[√] Android Studio (version 2021.1)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[√] VS Code (version 1.66.2)
• VS Code at C:\Users\Da2ny\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.613]
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.88
• Edge (web) • edge • web-javascript • Microsoft Edge 100.0.1185.29
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Process finished with exit code 0
My kotlin version: ext.kotlin_version = '1.6.10'
The added perms:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Could you please help me ?
if you recently upgrade your flutter you need to upgrade gradle and kotllin version in your app
download latest version of gradle and include it in your project like this:
in the following folder : andoid->geadle->wrapper-> in file grdle-wrapper.properites edit last line
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.1-all.zip
then upgrade kotlin version in build.gradle
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
I fixed it:
Updating compileSdkVersion to 32 in Android->App->build.gradle
Adding android:exported="true" to <activity in android->app->src->main->AndroidManifest.xml
Doing the modification of #AHMAD_AR
andoid->geadle->wrapper-> in file grdle-wrapper.properites edit last
line
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.1-all.zip
then upgrade kotlin version in build.gradle
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Reinstalling the last version of Flutter - Stable Channel