4

I am trying to sign a core application and a tests application for that core app.

I was getting the error:

Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:internal-integration-test (default-internal-integration-test) on project test: Test run failed to complete: Permission Denial: starting instrumentation ComponentInfo{packagename.core.tests/android.test.InstrumentationTestRunner} from pid=14383, uid=14383 not allowed because package packagename.core.tests does not have a signature matching the target packagename.core

I then tried to add in 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 project's pom.xml Here is the pom.xml code excerpt:

    <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 am getting the error when running mvn clean install:

Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (signing) on project projcore: Failed executing '/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'

yorkw
  • 40,926
  • 10
  • 117
  • 130

0 Answers0