2

Hello i have a problem when i compile with flutter

I have already tried to debug with flutter run -- debug but no success I think that from gradle but i don't know how to fix this.

    Resolving dependencies...                                           
    3,5s

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:packageDebug'.
    > Failed to generate v1 signature

    * 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 4s
    Running Gradle task 'assembleDebug'...
    Running Gradle task 'assembleDebug'... Done                         
    5,2s
    Gradle task assembleDebug failed with exit code 1

when i run flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.7.4-pre.27, on Microsoft Windows [version 
10.0.17763.503], locale fr-FR)

[√] Android toolchain - develop for Android devices (Android SDK version 
28.0.3)
[!] Visual Studio - develop for Windows (Visual Studio Community 2017 
15.9.12)
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
    MSBuild
    VC++ 2017 version 15.9 v14.16 latest v141 tools
    Windows 10 SDK (10.0.17763.0)
  [√] Android Studio (version 3.4)
  [√] VS Code (version 1.35.0)
  [√] Connected device (1 available)

  ! Doctor found issues in 1 category.

Please help me Thank you for your time and attention.

5 Answers 5

14

run flutter clean in terminal and run again

Sign up to request clarification or add additional context in comments.

1 Comment

it still works for 2022
3

Delete this file : ~/.android/debug.keystore

Comments

1

Solution 1

  1. run flutter clean
  2. flutter pub get get all dependency

Solution 2

add Multidex

android {
defaultConfig {
    ...
    minSdkVersion 15 
    targetSdkVersion 28
    multiDexEnabled true
}
...


dependencies {
   implementation "androidx.multidex:multidex:2.0.1"
}

Solution 3

delete ~/.android/debug.keystore in android sdk.

Note: Follow step wise, only try Solution 3 if above two doest work.

1 Comment

none of these worked :(
0

For me, i was able to run app by commenting release code from android/app/build.gradle file

//      signingConfigs {
//        release {
//            keyAlias keystoreProperties['keyAlias']
//            keyPassword keystoreProperties['keyPassword']
//            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
//            storePassword keystoreProperties['storePassword']
//        }
//    }
//    buildTypes {
//        release {
//            minifyEnabled true 
//             shrinkResources true
//            signingConfig signingConfigs.release
//        }
//    }

Uncomment with:

//Debug
    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
    //Debug

Comments

0

This worked for me

  1. Run flutter clean
  2. Get packages using flutter pub get
  3. Run again

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.