Maven-android-jarsigner failed to sign

I am trying to sign the main application and the testing application for this main application.

I was getting the error:

Failed to fulfill the goal com.jayway.maven.plugins.android.generation2: android-maven-plugin: 3.4.1: internal integration-test (default - internal integration-test) while testing the project: trial run failed to complete: Failure resolution: ComponentInfo launcher {packagename.core.tests / android.test.InstrumentationTestRunner} of pid = 14383, uid = 14383 is not allowed because packagename.core.tests does not have a signature that matches the target packagename.core

Then I tried to add the jarsigner plugin to my pom.xml using this code and a keystore called my-keystore.keystore, which is in the same directory as the pom.xml project Here is a snippet of pom.xml code:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jarsigner-plugin</artifactId> <version>1.2</version> <executions> <execution> <id>signing</id> <goals> <goal>sign</goal> </goals> <phase>package</phase> <inherited>true</inherited> <configuration> <archiveDirectory></archiveDirectory> <includes> <include>target/*.apk</include> </includes> <keystore>my-key.keystore</keystore> <storepass>namepass</storepass> <keypass>namepass</keypass> <alias>my_key</alias> <arguments> <argument>-sigalg</argument><argument>MD5withRSA</argument> <argument>-digestalg</argument><argument>SHA1</argument> </arguments> </configuration> </execution> </executions> </plugin> 

Now I get an error when running mvn clean install:

Failed to fulfill the target org.apache.maven.plugins: maven-jarsigner-plugin: 1.2: sign (signature) in the projcore project: Failed to execute '/ bin / sh -c cd / path / projcore && & &&& & / usr / lib / jvm / java-6-sun-1.6.0.33 / jre /../ bin / jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore my-key.keystore -storepass' '- keypass' '/path/core/target/projcore-1.7.8.apk my_key'

+4
source share

Source: https://habr.com/ru/post/1492173/


All Articles