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

1 篇文章 0 订阅
1 篇文章 0 订阅

<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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值