microsoft / vsts-cordova-tasks

Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
http://go.microsoft.com/fwlink/?LinkID=691188
Other
25 stars 27 forks source link

Cordova Build Android Ant Task Signing fails - You must specify a property filename when using the -propertyfile argument #51

Closed murraybauer closed 7 years ago

murraybauer commented 8 years ago

I have Cordova build task in my definition: Platform:Android Configuration:Release

I have set the advanced android settings with the signing keys and checked forced Ant Build otherwise the release.apk was unsigned.

However, it fails saying:

You must specify a property filename when using the -propertyfile argument

I am building using a local agent on MacOSX with the latest apache ant version 1.9.7 and Cordova 6.1.1

Based on the source code it looks like the VSTS task generates a .properties file for the ant task but the generated arguments for the ant command are not correct

Queueing build for platform android w/options: --release,--device,--ant,--keystore=/Users/administrator/Downloads/vsts-agent-darwin-2.99.0-0428/_work/1/s/config/app_signing/android/release_mode/release2.keystore,--storePassword=test1234,--alias=companyname,--password=test1234
2016-05-03T00:44:42.5074430Z Processing res/native for android
2016-05-03T00:44:43.4288350Z Test build @ platforms/android/assets/www/build/test does not exist for removal
2016-05-03T00:44:44.4294330Z ANDROID_HOME=/Applications/android-sdk-macosx/sdk
2016-05-03T00:44:44.4295040Z JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
2016-05-03T00:44:45.2472730Z You must specify a property filename when using the -propertyfile argument
murraybauer commented 8 years ago

I just used the built-in VSTS Android Signing task to sign the .apk and it worked OTB.

Chuxel commented 8 years ago

Interesting. The task is actually not specifying a property file interestingly - Cordova itself is doing that. This could be a Cordova bug.

Two questions:

  1. Are you able to successfully run a release build using ant from the command line using Cordova 6.1.1 on OSX?
  2. Can you clarify why you switched to Ant? Were you not seeing the build signed? Ant is a less common config for 6.1.1 and there's a number of plugins that do not support it.
murraybauer commented 8 years ago

Yes, the problem was that the release.apk file was unsigned with the certificate provided.

I ran this command to verify: zipalign -c -v 4 release

I tried ticking the ant build box to see if this was required to enable the signing - thinking ant was used to run the jarsigner and zipalign command tools. When I enabled this I started to get errors that the file path to my keystone etc was incorrect.

As mentioned, I subsequently just unticked the ant build, added the native VSTS Android Signing which signed the file.

Chuxel commented 8 years ago

@ryuyu will take a look. There was a recent vsts-task-lib update that could have had an unexpected impact on arg passing for Android signing - or there's an issue with Cordova 6.1.1. Glad you are unblocked in the mean time, however.

ryuyu commented 8 years ago

The ant thing appears to be a real issue which I am currently in the process of digging in to.

However, I was unable to reproduce the signing issue that you were seeing with Gradle. I tested against both windows and Ubuntu and was able to generate a signed binary in both cases with the default gradle build.

Could you maybe do a gradle build and post us the log so I can see what is being passed to cordova and if there are any warnings/errors? Thanks!.

bryanmacfarlane commented 8 years ago

Android signing was recently patched.

https://github.com/Microsoft/vsts-tasks/issues/1654

jmatthiesen commented 7 years ago

Hello, all! I'm closing out this issue since there hasn't been any recent discussion. Feel free to respond if you're still having problems here.