通过File/ProductStructure/Signing Configs 界面配置签名,配置路径是绝对路径。
如果需要配置相对路径,要在build.gradle文件中手写签名配置,参考方法如下:
module的build.gradle
debug {
storeFile file('../signs/MyDemo.p12')
storePassword '00000018E2C066D88C63B632AD57A0326B48EE4xxxxx'
keyAlias = 'MyDemo'
keyPassword '0000001849284C1126C07D64A4088E90E8B42502EA7D2BF1ED9400FDFxxx'
signAlg = 'SHA256withECDSA'
profile file('../signs/MyDemo.p7b')
certpath file('../signs/MyDemo.cer')
}
工程的build.gradle
release{
storeFile file('./signs/MyDemo.p12')
storePassword '00000018E2C066D88C63B632AD57A0326B48EE4xxxxx'
keyAlias = 'MyDemo'
keyPassword '0000001849284C1126C07D64A4088E90E8B42502EA7D2BF1ED9400FDFxxx'
signAlg = 'SHA256withECDSA'
profile file('./signs/MyDemo.p7b')
certpath file('./signs/MyDemo.cer')
}
其中,signs文件夹在工程根目录下(和entry文件夹的同级目录下)。
(signs文件夹名称可以自定义)