Je veux publier mon application mais empiler avec ce problème

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'D:\FlutterProjects\Panaszok\02012020 - Copy (2) - Copy\Multi Restaurants Flutter App\android\app\key\panaszok.jks' not found for signing config 'release'.

* 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 23s
Running Gradle task 'assembleRelease'...                           23.9s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1



----------------------------------Here is my build gradle-------------------------------------------------

    def localProperties = new Properties()
    def localPropertiesFile = rootProject.file('local.properties')
    if (localPropertiesFile.exists()) {
        localPropertiesFile.withReader('UTF-8') { reader ->
            localProperties.load(reader)
        }
    }

    def flutterRoot = localProperties.getProperty('flutter.sdk')
    if (flutterRoot == null) {
        throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
    }

    def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
    if (flutterVersionCode == null) {
        flutterVersionCode = '1'
    }

    def flutterVersionName = localProperties.getProperty('flutter.versionName')
    if (flutterVersionName == null) {
        flutterVersionName = '1.0'
    }

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

    def keystorePropertiesFile = rootProject.file("key.properties")
    def keystoreProperties = new Properties()
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

    android {
        compileSdkVersion 28

        sourceSets {
            main.java.srcDirs += 'src/main/kotlin'
        }

        lintOptions {
            disable 'InvalidPackage'
        }

        defaultConfig {
            // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
            applicationId "com.panaszok.app"
            minSdkVersion 21
            targetSdkVersion 28
            versionCode flutterVersionCode.toInteger()
            versionName flutterVersionName
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }

        signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile file(keystoreProperties['storeFile'])
                storePassword keystoreProperties['storePassword']
            }
        }

        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
                signingConfig signingConfigs.release
            }
        }
    }

    flutter {
        source '../..'
    }

    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'com.google.firebase:firebase-messaging:20.0.1'
        implementation 'androidx.annotation:annotation:1.1.0'
        implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    }

    //apply plugin: 'com.google.gms.google-services'

----------------------------------------Voici les propriétés clés------ -----------------------------------

storePassword=myPss
keyPassword=MyKpss
keyAlias=key
storeFile=D:/FlutterProjects/Panaszok/02012020 - Copy (2) - Copy/Multi Restaurants Flutter App/android/app/key/panaszok.jks

--------------------------------------Voici le docteur flutter -v------ -----------------------------------

    [√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
        • Flutter version 1.12.13+hotfix.7 at C:\src\flutter
        • Framework revision 9f5ff2306b (3 weeks ago), 2020-01-26 22:38:26 -0800
        • Engine revision a67792536c
        • Dart version 2.7.0


    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at C:\Users\Office\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-29, build-tools 29.0.2
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
        • All Android licenses accepted.

    [√] Android Studio (version 3.5)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin version 43.0.1
        • Dart plugin version 191.8593
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

    [√] VS Code (version 1.41.1)
        • VS Code at C:\Users\Office\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.7.1

    [√] Connected device (1 available)
        • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)

• No issues found!

J'ai essayé cette méthode mais cela n'a pas aidé et a donné une autre erreur

 buildTypes {
        release {
            shrinkResources true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
        }
    }

----------------------------------Erreur après minifyEnabled false ----------- --------------------------------

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\FlutterProjects\Panaszok\02012020 - Copy (2) - Copy\Multi Restaurants Flutter App\android\build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Removing unused resources requires unused code shrinking to be turned on. See http://d.android.com/r/tools/shrink-resources.html for more information.

* 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 870ms
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                       1.5s
Gradle task assembleRelease failed with exit code 1
6
Muhammad Amin 14 févr. 2020 à 23:29

2 réponses

Meilleure réponse

Le problème est clair

Fichier de magasin de clés introuvable pour la signature de la « version » de la configuration

Vérifier ce chemin

'D:\FlutterProjects\Panaszok\02012020 - Copy (2) - Copy\Multi Restaurants Flutter App\android\app\key\panaszok.jks'
5
Mohamed Sayed 15 févr. 2020 à 12:14

Vous devriez vérifier les informations keyAlias, storeFile .. dans le fichier key.properties. Si votre fichier key.properties est différent de votre fichier de signature, vous obtiendrez cette erreur.

3
kk. 29 sept. 2020 à 09:14