Error on Updating Android Studio 4.1. and getting error for using TargetSDK Version 29

2,122

My error.

my error

I solved my issue with dart and flutter plugins issue by running:

flutter channel dev

flutter upgrade

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

flutter doctor -v
Share:
2,122
Pramod Yadav
Author by

Pramod Yadav

Updated on December 25, 2022

Comments

  • Pramod Yadav
    Pramod Yadav over 1 year

    Today I updated my Android Studio to 4.1 and I got many errors in after running flutter Doctor I found this. And please also tell me how to update SDK version 29.

    enter image description here

    I have tried to update my Android SDK Version to 29 and tried many answer of stackoverflow and github but can not solve this problem.

    I have installed flutter and dart plugin and also project is running but flutter doctor not found the location of flutter and dart plugins.

    enter image description here

    and After changing the targetSdk version to 29 from 28 I am getting this error.

    Launching lib\main.dart on Android SDK built for x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    Checking the license for package Android SDK Platform 29 in C:\Program Files (x86)\Android\android-sdk\licenses
    License for package Android SDK Platform 29 accepted.
    Preparing "Install Android SDK Platform 29 (revision: 5)".
    Warning: Failed to read or create install properties file.
    
    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:
          platforms;android-29 Android SDK Platform 29
      The SDK directory is not writable (C:\Program Files (x86)\Android\android-sdk)
    
    
    * 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 14s
    Exception: Gradle task assembleDebug failed with exit code 1
    

    I tried almost every solution from old answers on stackoverflow and github but nothing worked for me.

    • Selvin
      Selvin over 3 years
      The SDK directory is not writable (C:\Program Files (x86)\Android\android-sdk) ...what do you not understand? with basic Windows OS knowladge you should know that you know admin rights ... Did you read this at least?
    • Pramod Yadav
      Pramod Yadav over 3 years
      Now what should I do to get the solution ?