当直接运行release版本时,报错Error: The apk for your currently selected variant cannot be signed. Please specify a signing configuration for this variant (package64-release).
解决报错:添加签名,signingConfigs 写在buildTypes前面,添加signingConfig signingConfigs.release
android {signingConfigs {debug {keyAlias 'xx'keyPassword 'xx'storeFile file('xx.jks')storePassword 'xx'v1SigningEnabled truev2SigningEnabled true}release {keyAlias 'xx'keyPassword 'zikao.2021'storeFile file('xx.jks')storePassword 'xx'v1SigningEnabled truev2SigningEnabled true}}buildTypes {debug {minifyEnabled falsezipAlignEnabled falseshrinkResources falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'signingConfig signingConfigs.debug}release {minifyEnabled truezipAlignEnabled trueshrinkResources trueproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'signingConfig signingConfigs.release}}
}