When I make a build of flutter project on windows(chrome) it run successfully but when i run on my phone it gives this error
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following SDK components:
tools Android SDK Tools
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
The SDK directory is not writable (C:\Users\Cantt)
* 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 1m 44s
Exception: Gradle task assembleDebug failed with exit code 1
I installed the Andriod SDK platform 32 and 31. please help how to fix this issue.
CodePudding user response:
Try the following on Android Studio.
Help>Find Action and then search for each and select:
- clean project
- rebuild project
- Invalidate caches
Then restart Android Studio.
This should fix the issue.
CodePudding user response:
- Open android studio and go to SDK manager
- Check SDK platforms API level 28, 29, 30
- Then apply and ok
Then
flutter clean
flutter pub get
flutter run