TimeToCode
TimeToCode

Reputation: 1838

Flutter project is not running on physical device

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.

Upvotes: 1

Views: 969

Answers (2)

MD MEHEDI HASAN
MD MEHEDI HASAN

Reputation: 2470

  1. Open android studio and go to SDK manager
  2. Check SDK platforms API level 28, 29, 30
  3. Then apply and ok

Then

flutter clean 
flutter pub get 
flutter run

Upvotes: 1

Gerry
Gerry

Reputation: 1479

Try the following on Android Studio.

Help>Find Action and then search for each and select:

  1. clean project
  2. rebuild project
  3. Invalidate caches

Then restart Android Studio.

This should fix the issue.

Upvotes: 0

Related Questions