Search code examples
androidfluttermavengradlemaven-2

I face this problem with building gradle , how can I fix it?


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 sdk-common-30.1.2.jar (com.android.tools:sdk-common:30.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.1.2/sdk-common-30.1.2.jar Could not find repository-30.1.2.jar (com.android.tools:repository:30.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/repository/30.1.2/repository-30.1.2.jar Could not find gradle-api-7.1.2.jar (com.android.tools.build:gradle-api:7.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-api/7.1.2/gradle-api-7.1.2.jar Could not find builder-test-api-7.1.2.jar (com.android.tools.build:builder-test-api:7.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/builder-test-api/7.1.2/builder-test-api-7.1.2.jar Could not find ddmlib-30.1.2.jar (com.android.tools.ddms:ddmlib:30.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/ddms/ddmlib/30.1.2/ddmlib-30.1.2.jar Could not find aaptcompiler-7.1.2.jar (com.android.tools.build:aaptcompiler:7.1.2). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/aaptcompiler/7.1.2/aaptcompiler-7.1.2.jar Could not find bundletool-1.8.0.jar (com.android.tools.build:bundletool:1.8.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/1.8.0/bundletool-1.8.0.jar Could not find aapt2-proto-7.1.2-7984345.jar (com.android.tools.build:aapt2-proto:7.1.2-7984345). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2-proto/7.1.2-7984345/aapt2-proto-7.1.2-7984345.jar Could not find crash-30.1.2.jar (com.android.tools.analytics-library:crash:30.1.2).


Solution

  • Try

    flutter clean
    dart pub get
    flutter pub get
    flutter run
    

    If this not resolved the problem, try deleting app/build folder & or app/android/app/build folder