preface

Today, I encountered some magical problems while packing at AAB

jarsigner.exefailed with exit code 1

The development environment

  • Android Studio: 4.2.0
  • Gradle plugin version: 3.2.1
  • Gradle version required: 4.8.1

Run the debug package no problem directly, APK package also normal, problem has been an error to the aab package:

Cause: jarsigner exefailed with exit code 1: � � � �. � Ҳ � � � � � � ޷ � � � � � � � � � sun. Security. View jarsigner. MainCopy the code

Build output: Build output: Build output: Build output

The solution

  • Upgrade Gradle plugin version 4.2.0
  • Upgrade Gradle required version: 6.7.1

Aab packaging is normal, problem solved.

To view the official documentation, only Android Studio 3.2 or later is required. Did not understand, know the big guy hard to help answer.

Execution failed for task ‘:app:transformClassesWithDexBuilderForRelease’.

This is an intuitive problem. It could be a Gradle problem

The development environment

  • Android Studio: 4.2.0
  • Gradle plugin version: 3.2.1
  • Gradle version required: 4.8.1

This time running debug package is not working

The solution

  • 1. Check whether Gradle plugin version is consistent with Gradle required version
  • Upgrade Gradle plugin version and Gradle required version

Since this problem is solved, refer to solution 2 to solve the problem of Cause: jarsigner. Exefailed with exit code 1

Refer to Gradle plugin for Gradle required version

Cause: failed to decrypt safe contents entry: java.io.IOException: getSecretKey failed: Password is not ASCII

JKS password is incorrect, you can re-enter it when packing.

This article is used to document AAB packaging errors. Continuing updates ~

The Build output garbled

Operating environment: Android Studio version 4.2.0

Methods a

  • 1. Click Help, select Edit Custom VM Options, and click Create

  • 2. Enter -dfile. encoding=UTF-8(do not leave a space before it; otherwise, AS cannot be opened) and restart Android Studio(select Invalidate cache/restart for FIle).

Method 2

Add -dconsole. encoding=UTF-8 to scheme 1 -dfile. encoding=UTF-8

Methods three

Go to studio64.exe.vmoptions in the bin folder of Android Studio installation directory and add -dfile. encoding= utF-8.

Methods four

Add the following code under the Android node in app/build.gradle:

android {
    android {
        // Solve the problem of garbled output of build output
        compileOptions.encoding = "UTF-8"}}Copy the code

Methods five

The above solution solves the problem of most people, but mine is no good, willful, there is a powerful boss trouble to give directions. Thank you.