flutter - 任务 ':app:signReleaseBundle' 执行失败

标签 flutter visual-studio android-studio dart keystore

我现在有这个错误来制作 flutter build appbundle

这是错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:signReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Failed to read key sd from store "C:\flutter_project\cursin2\cursin-main\android\app\upload-keystore.jks": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available

* 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
Running Gradle task 'bundleRelease'...                              9,1s
Gradle task bundleRelease failed with exit code 1
PS C:\flutter_project\cursin2\cursin-main> 

enter image description here

我已经尝试了所有方法来修复它,但错误仍然出现。

我的 key .properties:

storePassword=ul109000
keyPassword=ul109000
keyAlias=sd
storeFile=C:/flutter_project/cursin2/cursin-main/android/app/upload-keystore.jks

最佳答案

在android app/build.gradle

android 标签内

def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    if (keystorePropertiesFile.exists()) {
        keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }

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

storeFile 路径将是 ./upload-keystore.jks

 buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            minifyEnabled true
            shrinkResources true
            signingConfig signingConfigs.release
        }
    }

关于flutter - 任务 ':app:signReleaseBundle' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70780523/

相关文章:

flutter - 抛出了另一个异常 : FormatException: Invalid number (at character 1)

c# - 如何使用 UI 自动化选择树项?

c# - ping 大量 IP 地址的最快方法?

android - Android Studio Gradle无法同步

flutter - 启用捏合和放大webview_flutter,在此处添加代码段[this.webView.getSettings()。setBuiltInZoomControls(true);]

java - Java 服务器的语言支持在过去 3 分钟内崩溃了 5 次。服务器不会重启

flutter - Dart,在代理模式中以 DRY 或合成方式覆盖许多 getter 和 setter

c++ - 当基类成员的析构函数具有非空 noexcept 说明符和主体时,析构函数上的 C2694

android - Open GL ES - GLM 库和 Android Studio

android - 无法启动Gradle守护程序。而且由于非ASCII字符而无法加载Project