使用maven自动打包android应用签名后报错:INSTALL_PARSE_FAILED_NO_CERTIFICATES

来源:互联网 发布:淘宝上解id锁是真的吗 编辑:程序博客网 时间:2024/04/30 03:43

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">使用maven自动打包并签名android应用后app无法安装,报错:INSTALL_PARSE_FAILED_NO_CERTIFICATES,解决方案如下:</span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"></span><pre name="code" class="html"><span style="white-space:pre"></span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">只需要加入红色字体部分即可,删除已存在的签名。</span>

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jarsigner-plugin</artifactId><version>1.2</version><executions><execution><id>sign</id><goals><goal>sign</goal></goals><phase>package</phase><inherited>true</inherited><configuration><includes><include>${project.build.outputDirectory}/*.apk</include></includes><span style="color:#ff6666;"><span style="white-space:pre"></span><removeExistingSignatures>true</removeExistingSignatures></span><keystore>${keystore.filename}</keystore><storepass>${keystore.storepass}</storepass><keypass>${keystore.keypass}</keypass><alias>${keystore.alias}</alias></configuration></execution></executions></plugin>

如果使用JDK1.7以上的JDK版本,还需配置以下红线部分参数:

<configuration><span style="white-space:pre"></span><includes><span style="white-space:pre"></span><include>${project.build.outputDirectory}/*.apk</include><span style="white-space:pre"></span></includes><span style="white-space:pre"></span><removeExistingSignatures>true</removeExistingSignatures><span style="white-space:pre"></span><keystore>${keystore.filename}</keystore><span style="white-space:pre"></span><storepass>${keystore.storepass}</storepass><span style="white-space:pre"></span><keypass>${keystore.keypass}</keypass><span style="white-space:pre"></span><alias>${keystore.alias}</alias><span style="color:#ff6666;"><span style="white-space:pre"></span><arguments><span style="white-space:pre"></span><argument>-sigalg</argument><span style="white-space:pre"></span><argument>MD5withRSA</argument><span style="white-space:pre"></span><argument>-digestalg</argument><span style="white-space:pre"></span><argument>SHA1</argument><span style="white-space:pre"></span></arguments></span></configuration>



0 0
原创粉丝点击