Execution failed for task ':app:validateSigningDebug'. java.util.concurrent.ExecutionException:

1,101

The problem has been solved with these steps:

I am a Windows User so these steps applying in Windows.

  1. Adding English Language for windows display from Control Panel.
  2. Change windows region format to US from Control Panel.
  3. Open SDK Update Sites tab in SDK Manager and see if there is 15 URLs for updates Otherwise relook to Windows Region Format from windows Control Panel.
  4. Update Android SDK Build-Tools to last stable version from SDK Manager.
  5. Update Android Emulator from SDK Manager.
  6. Update Android SDK Platform-Tools to last stable version from SDK Manager.
  7. Uninstall Android Image then reinstall it again.
  8. Clear caches from "C:\Users\USER_NAME.gradle\caches".
  9. Clear caches from "C:\Users\USER_NAME.android\cache".
  10. restart Windows and create a new App and connect a Physical Device and run it with flutter clear then run it normally.
  11. After run it successfully, open AVD Manger and Create a new Virtual Device and choose the best ABI which is x86.
  12. Finally Run the app on that new emulator.

I've done all of these steps since the problem arose and did nothing else. I don't know which of them solve the problem, but in the end everything works fine. I hope this solution helps other people because I found the problem recurring in many and none of it has been resolved. My greetings.

Share:
1,101
Abdullah Bahattab
Author by

Abdullah Bahattab

LoveProgramming = true; do { LearningC#(); LearningSQLServer(); LearningJava(); LearningAndroid(); LearningXcode(); LearningPL/SQL(); LearningOracle(); LearningFlutter(); } while(LoveProgramming);

Updated on December 16, 2022

Comments

  • Abdullah Bahattab
    Abdullah Bahattab over 1 year

    I just created a new flutter app and when I tried to run it on an emulator then this error message appears:

    Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:validateSigningDebug'. java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
    • 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 6s Exception: Gradle task assembleDebug failed with exit code 1

    Here is my build.gradle

    buildscript {
        ext.kotlin_version = '1.5.10'
        repositories {
            google()
            mavenCentral()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:4.1.0'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    }
    
    allprojects {
        repositories {
            google()
            mavenCentral()
        }
    }
    
    rootProject.buildDir = '../build'
    subprojects {
        project.buildDir = "${rootProject.buildDir}/${project.name}"
        project.evaluationDependsOn(':app')
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    And here is my gradle.properties

    org.gradle.jvmargs=-Xmx1536M
    android.useAndroidX=true
    android.enableJetifier=true
    

    Also here is my gradle-wrapper.properties

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
    

    Also here is flutter doctor -v restult:

    PS D:\flutter_apps\angila\flutter_application_4> flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.631], locale ar-YE)
    [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    [√] Chrome - develop for the web
    [√] Android Studio (version 2020.3)
    [√] Android Studio
    [√] VS Code (version 1.62.1)
    [√] Connected device (3 available)
    
    • No issues found!
    PS D:\flutter_apps\angila\flutter_application_4> flutter doctor -v
    [√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.631], locale ar-YE)
        • Flutter version 2.5.2 at C:\src\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 3595343e20 (6 weeks ago), 2021-09-30 12:58:18 -0700
        • Engine revision 6ac856380f
        • Dart version 2.14.3
    
    [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at C:\src\Sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = C:\src\Sdk
        • Java binary at: C:/Program Files/Android/Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Android Studio (version 2020.3)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [√] Android Studio
        • Android Studio at C:/Program Files/Android/Android Studio
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = C:/Program Files/Android/Android Studio
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [√] VS Code (version 1.62.1)
        • VS Code at C:\Users\Abdullah\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.28.0
    
    [√] Connected device (3 available)
        • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 11 (API 30) (emulator)
        • Chrome (web)               • chrome        • web-javascript • Google Chrome 95.0.4638.69
        • Edge (web)                 • edge          • web-javascript • Microsoft Edge 95.0.1020.44
    
    • No issues found!
    

    This is a new app and I don't doing Google Sign-in in my app. Also This error occurs in every new application and old apps which is created and debugged before and in Android Studio or VS Code. This error occurs after formatting my pc and reinstalled windows.