使用 fvm 构建 apk 时出现错误

问题描述 投票:0回答:1

我正在尝试使用以下 cmd 构建 apk

fvm flutter build apk
我收到下面提到的错误,请提出解决方案。

错误:

PS C:\Users\ARcaN\Desktop\otrack_flutter_app> fvm flutter build apk

 Building with sound null safety 


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDevRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > SigningConfig "release" is missing required property "storeFile".

* 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 4m 11s
Running Gradle task 'assembleRelease'...                          255.1s
Gradle task assembleRelease failed with exit code 1
flutter build apk flutter-apk fvm
1个回答
0
投票

您的错误SigningConfig“release”缺少必需的属性“storeFile”清楚地表明您缺少签名详细信息。

您需要在

android/app/build.gradle file

下添加签名详细信息,例如 keyAlias、keyPassword ...

简而言之,您需要让 Android 了解您的签名详细信息,以便他们可以签署您的应用程序并为您提供版本。您可以使用签名详细信息创建调试版本

这是示例格式

signingConfigs {

    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
        storePassword keystoreProperties['storePassword']
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

关注这篇文章了解更多

https://blog.codemagic.io/the-simple-guide-to-android-code-signing/

© www.soinside.com 2019 - 2024. All rights reserved.