James Parker James Parker - 5 months ago 44
Android Question

Unable to Sign Xamarin Android APK Through Visual Studio Team Services

I'm trying to run a Xamarin Forms shared solution build using Visual Studio Team Services. These are the steps that I have included in the build currently
- Xamarin Component restore
- NuGet restore
- Build Xamarin.Android
- Build solution
- Signing and aligning APK file
- Publish Artifact
- Deploy (HockeyApp)

If I don't try to sign the APK file using Jarsigner the build work successfully and the apk file is uploaded to HockeyApp. However HockeyApp requires that the APK file be signed.

When I enable the Jarsigner options within the 'Signing and aligning APK' build step I get the following error.

2016-05-13T23:34:04.7265700Z [command]C:\java\jdk\jdk1.8.0_25\bin\jarsigner -keystore **/project.keystore -storepass abc123 -keypass abc123 -signedjar C:/a/1/b/bin/release/project.project.apk C:/a/1/b/bin/release/project.project.apk.unsigned project_key
2016-05-13T23:34:08.0070913Z jarsigner error: java.lang.RuntimeException: keystore load: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.99.0\tasks\AndroidSigning\1.0.16\**\project.keystore (The filename, directory name, or volume label syntax is incorrect)


I have the project.keystore file located in the root of the repo and I'm using a hosted solution for Visual Studio Team Services. This is the last item I need to get working for the build to be successful any help would be appreciated.

Answer

Solved the issue. The problem was I wasn't referencing the full path of the keystore located in the root of the repository. This is how you should reference it.

$(build.sourcesdirectory)/project.keystore
Comments