4

I have been working with < 5 version of android platform in my hybrid application. now I updated the version by removing first ionic platform rm android and then ionic platform add android@5.0.0. With previous version I was able to create signed release build with this command without any problem

cordova build android --release --buildConfig=build.json -- --gradleArg=-PcdvMinSdkVersion=16

but after adding this version android@5.0.0, when I run the build command it gives me android-release-unsigned.apk

Note: I am using same keystore as previously I was using

Update:

{ 
"android": {
        "release": {
        "keystore": "C:\\Path\\To\\Keystores\\theapp.keystore",
        "storePassword": "",
        "alias": "thealias",
        "password" : "",
        "keystoreType": ""
    } 
}
Abdul
  • 1,416
  • 9
  • 26
  • 57
  • 1
    Check out this question: http://stackoverflow.com/questions/40349848/cordova-6-4-0-android-error-when-building-release-apk/40884993#40884993 – daserge Dec 08 '16 at 09:59
  • @daserge The link you mentioned talks about issue related to android@6.0.0 but the question is about android@5.0.0 – Gandhi Dec 14 '16 at 05:55
  • Right. I'm just not sure when this has broken - it must be some Gradle update. @Qadeer - have you figured this out? – daserge Dec 14 '16 at 11:58
  • Have you tried to manually zipalign the apk? Something like `zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk platforms/android/build/outputs/apk/android-release.apk`. This gives a android-release.apk which can be used for the store. – JanP Dec 14 '16 at 12:19
  • @daserge then how to update gradle – Abdul Dec 14 '16 at 12:30
  • @JanP sorry I don't know the way you are referring. – Abdul Dec 14 '16 at 12:31
  • Why downvote? isn't it a issue? – Abdul Dec 14 '16 at 12:32
  • I didn't down vote, must be someone else. Maybe this gives more info? https://ionicframework.com/docs/guide/publishing.html, also about zipalign – JanP Dec 14 '16 at 12:41
  • @Qadeer Try applying [this patch](https://github.com/apache/cordova-android/pull/351/files#diff-c37e154983ced1f8b9a9fa3754f78542R267) to your build.gradle file. – daserge Dec 14 '16 at 13:17
  • This link can help you : http://stackoverflow.com/questions/26449512/how-to-create-signed-apk-file-using-cordova-command-line-interface – Rai Vu Dec 19 '16 at 04:02

0 Answers0