Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. problem on flutter

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3 platforms;android-28 Android SDK Platform 28 To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: C:\Users\emre\AppData\Local\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 11s

FAILURE: Build failed with an exception.

  • What went wrong: Could not update C:\Users\emre.gradle\caches\5.6.2\file-changes\last-build.bin

C:\Users\emre.gradle\caches\5.6.2\file-changes\last-build.bin (Access is denied)

  • 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 11s Exception: Gradle task assembleDebug failed with exit code 1

like image 992
Emre Kızıltoprak Avatar asked Dec 22 '22 17:12

Emre Kızıltoprak


2 Answers

Apparently you should accept the license,so in your command promp:

cd /d "%ANDROID_SDK_ROOT%/tools/bin"

and then

sdkmanager --licenses

just accept the license and the error should goes away.

like image 68
Payam Asefi Avatar answered Feb 02 '23 00:02

Payam Asefi


Here is the main problem

Failed to install the following Android SDK packages as some licenses have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3 platforms;android-28 Android SDK Platform 28

As the error suggests, first accept all licenses by running the following command

flutter doctor --android-licenses

next head over to https://androidsdkmanager.azurewebsites.net/Buildtools and download the build tool that corresponds to the one you are missing in this case 28.0.3 After downloading extract the zip file into C:\Android\Sdk\build-tools\28.0.3 if you are on windows and /Library/Android/sdk/build-tools/28.0.3 if you are on mac

finally, download the missing Android SDK platform 28 from https://androidsdkmanager.azurewebsites.net/SDKPlatform and unzip it into /Library/Android/sdk/platforms/android-28 if you are on mac or C:\Android\Sdk\platforms\android-28 if you are on windows

Run your project (flutter run) and enjoy

like image 32
ARMEL FOPA Avatar answered Feb 02 '23 00:02

ARMEL FOPA