Fastlane and Ionic Android : apkUpgradeVersionConflict











up vote
1
down vote

favorite












I tried to use Fastlane to deploy my Ionic App on playstore (track alpha) but I have this error :



[15:03:33]: Preparing to upload for language 'fr-FR'...
[15:03:34]: Preparing apk at path 'platforms/android/app/build/outputs/apk/release/android-release.apk' for upload...
+------------------+----------------+
| Lane Context |
+------------------+----------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | |
| LANE_NAME | android_deploy |
+------------------+----------------+
[15:04:41]: Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.

+------+----------------------------+-------------+
| fastlane summary |
+------+----------------------------+-------------+
| Step | Action | Time (in s) |
+------+----------------------------+-------------+
| 1 | Verifying fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | ionic | 126 |
| 💥 | supply | 70 |
+------+----------------------------+-------------+

[15:04:41]: fastlane finished with errors

[!] Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.


I tried to increment manually my android-versionCode but nothing better :



<widget android-versionCode="3" id="com.myCompagny.myApp" version="0.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


For my versionCode I tried "4" and "103" but nothing better. (Like this)



What can I do to solve that ?



My Ionic info :



Ionic:

ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 9 other plugins)

System:

ios-deploy : 2.0.0
NodeJS : v8.9.4 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b


Fastlane V : 2.108.0










share|improve this question


























    up vote
    1
    down vote

    favorite












    I tried to use Fastlane to deploy my Ionic App on playstore (track alpha) but I have this error :



    [15:03:33]: Preparing to upload for language 'fr-FR'...
    [15:03:34]: Preparing apk at path 'platforms/android/app/build/outputs/apk/release/android-release.apk' for upload...
    +------------------+----------------+
    | Lane Context |
    +------------------+----------------+
    | DEFAULT_PLATFORM | ios |
    | PLATFORM_NAME | |
    | LANE_NAME | android_deploy |
    +------------------+----------------+
    [15:04:41]: Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.

    +------+----------------------------+-------------+
    | fastlane summary |
    +------+----------------------------+-------------+
    | Step | Action | Time (in s) |
    +------+----------------------------+-------------+
    | 1 | Verifying fastlane version | 0 |
    | 2 | default_platform | 0 |
    | 3 | ionic | 126 |
    | 💥 | supply | 70 |
    +------+----------------------------+-------------+

    [15:04:41]: fastlane finished with errors

    [!] Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.


    I tried to increment manually my android-versionCode but nothing better :



    <widget android-versionCode="3" id="com.myCompagny.myApp" version="0.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


    For my versionCode I tried "4" and "103" but nothing better. (Like this)



    What can I do to solve that ?



    My Ionic info :



    Ionic:

    ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic)
    Ionic Framework : ionic-angular 3.9.2
    @ionic/app-scripts : 3.2.0

    Cordova:

    cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
    Cordova Platforms : android 7.0.0, ios 4.5.5
    Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 9 other plugins)

    System:

    ios-deploy : 2.0.0
    NodeJS : v8.9.4 (/usr/local/bin/node)
    npm : 6.4.1
    OS : macOS High Sierra
    Xcode : Xcode 9.2 Build version 9C40b


    Fastlane V : 2.108.0










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I tried to use Fastlane to deploy my Ionic App on playstore (track alpha) but I have this error :



      [15:03:33]: Preparing to upload for language 'fr-FR'...
      [15:03:34]: Preparing apk at path 'platforms/android/app/build/outputs/apk/release/android-release.apk' for upload...
      +------------------+----------------+
      | Lane Context |
      +------------------+----------------+
      | DEFAULT_PLATFORM | ios |
      | PLATFORM_NAME | |
      | LANE_NAME | android_deploy |
      +------------------+----------------+
      [15:04:41]: Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.

      +------+----------------------------+-------------+
      | fastlane summary |
      +------+----------------------------+-------------+
      | Step | Action | Time (in s) |
      +------+----------------------------+-------------+
      | 1 | Verifying fastlane version | 0 |
      | 2 | default_platform | 0 |
      | 3 | ionic | 126 |
      | 💥 | supply | 70 |
      +------+----------------------------+-------------+

      [15:04:41]: fastlane finished with errors

      [!] Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.


      I tried to increment manually my android-versionCode but nothing better :



      <widget android-versionCode="3" id="com.myCompagny.myApp" version="0.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


      For my versionCode I tried "4" and "103" but nothing better. (Like this)



      What can I do to solve that ?



      My Ionic info :



      Ionic:

      ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic)
      Ionic Framework : ionic-angular 3.9.2
      @ionic/app-scripts : 3.2.0

      Cordova:

      cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
      Cordova Platforms : android 7.0.0, ios 4.5.5
      Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 9 other plugins)

      System:

      ios-deploy : 2.0.0
      NodeJS : v8.9.4 (/usr/local/bin/node)
      npm : 6.4.1
      OS : macOS High Sierra
      Xcode : Xcode 9.2 Build version 9C40b


      Fastlane V : 2.108.0










      share|improve this question













      I tried to use Fastlane to deploy my Ionic App on playstore (track alpha) but I have this error :



      [15:03:33]: Preparing to upload for language 'fr-FR'...
      [15:03:34]: Preparing apk at path 'platforms/android/app/build/outputs/apk/release/android-release.apk' for upload...
      +------------------+----------------+
      | Lane Context |
      +------------------+----------------+
      | DEFAULT_PLATFORM | ios |
      | PLATFORM_NAME | |
      | LANE_NAME | android_deploy |
      +------------------+----------------+
      [15:04:41]: Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.

      +------+----------------------------+-------------+
      | fastlane summary |
      +------+----------------------------+-------------+
      | Step | Action | Time (in s) |
      +------+----------------------------+-------------+
      | 1 | Verifying fastlane version | 0 |
      | 2 | default_platform | 0 |
      | 3 | ionic | 126 |
      | 💥 | supply | 70 |
      +------+----------------------------+-------------+

      [15:04:41]: fastlane finished with errors

      [!] Google Api Error: apkUpgradeVersionConflict: APK specifies a version code that has already been used.


      I tried to increment manually my android-versionCode but nothing better :



      <widget android-versionCode="3" id="com.myCompagny.myApp" version="0.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


      For my versionCode I tried "4" and "103" but nothing better. (Like this)



      What can I do to solve that ?



      My Ionic info :



      Ionic:

      ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic)
      Ionic Framework : ionic-angular 3.9.2
      @ionic/app-scripts : 3.2.0

      Cordova:

      cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
      Cordova Platforms : android 7.0.0, ios 4.5.5
      Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 9 other plugins)

      System:

      ios-deploy : 2.0.0
      NodeJS : v8.9.4 (/usr/local/bin/node)
      npm : 6.4.1
      OS : macOS High Sierra
      Xcode : Xcode 9.2 Build version 9C40b


      Fastlane V : 2.108.0







      android ionic3 fastlane






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 14:14









      V. Pivet

      31121743




      31121743
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          0
          down vote













          You should change not only the AndroidManifest.xml android-versionCode, also the build.gradle versionCode to a greater number than the one on Google Play.



          As you use fastlane I recomment you to use google_play_track_version_codes to get the last code version Google Play and android versioning plugin (look at the refs) that automatically changes your code version. In that way you can take the Google Play one, sum 1 and upload it without any problem



          refs:
          https://docs.fastlane.tools/actions/google_play_track_version_codes/
          https://github.com/otkmnb2783/fastlane-plugin-android_versioning






          share|improve this answer




























            up vote
            0
            down vote













            You're uploading an apk with the same version, in order to fix this open up your ionic config.xml file and change the version attribute on line 2 to a greater version.



            From:



            <widget id="com.company.appname" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


            To:



            <widget id="com.company.appname" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


            Then compile it again to get the new build version.






            share|improve this answer




























              up vote
              0
              down vote













              As per cordova's documentation versioCode



              Expressed in major/minor/patch notation.



              For example version 30.20.48 would be written as 302048.
              The way you have incremented it, the app is on version 3 right now. Try setting the versionCode as recommended and you should be fine.



              Read More: config.xml - https://cordova.apache.org/docs/en/latest/config_ref/ Android



              Platform Guide - https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code






              share|improve this answer





















                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53209546%2ffastlane-and-ionic-android-apkupgradeversionconflict%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                0
                down vote













                You should change not only the AndroidManifest.xml android-versionCode, also the build.gradle versionCode to a greater number than the one on Google Play.



                As you use fastlane I recomment you to use google_play_track_version_codes to get the last code version Google Play and android versioning plugin (look at the refs) that automatically changes your code version. In that way you can take the Google Play one, sum 1 and upload it without any problem



                refs:
                https://docs.fastlane.tools/actions/google_play_track_version_codes/
                https://github.com/otkmnb2783/fastlane-plugin-android_versioning






                share|improve this answer

























                  up vote
                  0
                  down vote













                  You should change not only the AndroidManifest.xml android-versionCode, also the build.gradle versionCode to a greater number than the one on Google Play.



                  As you use fastlane I recomment you to use google_play_track_version_codes to get the last code version Google Play and android versioning plugin (look at the refs) that automatically changes your code version. In that way you can take the Google Play one, sum 1 and upload it without any problem



                  refs:
                  https://docs.fastlane.tools/actions/google_play_track_version_codes/
                  https://github.com/otkmnb2783/fastlane-plugin-android_versioning






                  share|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    You should change not only the AndroidManifest.xml android-versionCode, also the build.gradle versionCode to a greater number than the one on Google Play.



                    As you use fastlane I recomment you to use google_play_track_version_codes to get the last code version Google Play and android versioning plugin (look at the refs) that automatically changes your code version. In that way you can take the Google Play one, sum 1 and upload it without any problem



                    refs:
                    https://docs.fastlane.tools/actions/google_play_track_version_codes/
                    https://github.com/otkmnb2783/fastlane-plugin-android_versioning






                    share|improve this answer












                    You should change not only the AndroidManifest.xml android-versionCode, also the build.gradle versionCode to a greater number than the one on Google Play.



                    As you use fastlane I recomment you to use google_play_track_version_codes to get the last code version Google Play and android versioning plugin (look at the refs) that automatically changes your code version. In that way you can take the Google Play one, sum 1 and upload it without any problem



                    refs:
                    https://docs.fastlane.tools/actions/google_play_track_version_codes/
                    https://github.com/otkmnb2783/fastlane-plugin-android_versioning







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 8 at 15:11









                    rcarba

                    716




                    716
























                        up vote
                        0
                        down vote













                        You're uploading an apk with the same version, in order to fix this open up your ionic config.xml file and change the version attribute on line 2 to a greater version.



                        From:



                        <widget id="com.company.appname" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                        To:



                        <widget id="com.company.appname" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                        Then compile it again to get the new build version.






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          You're uploading an apk with the same version, in order to fix this open up your ionic config.xml file and change the version attribute on line 2 to a greater version.



                          From:



                          <widget id="com.company.appname" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                          To:



                          <widget id="com.company.appname" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                          Then compile it again to get the new build version.






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            You're uploading an apk with the same version, in order to fix this open up your ionic config.xml file and change the version attribute on line 2 to a greater version.



                            From:



                            <widget id="com.company.appname" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                            To:



                            <widget id="com.company.appname" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                            Then compile it again to get the new build version.






                            share|improve this answer












                            You're uploading an apk with the same version, in order to fix this open up your ionic config.xml file and change the version attribute on line 2 to a greater version.



                            From:



                            <widget id="com.company.appname" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                            To:



                            <widget id="com.company.appname" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">


                            Then compile it again to get the new build version.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 8 at 15:15







                            user6358125





























                                up vote
                                0
                                down vote













                                As per cordova's documentation versioCode



                                Expressed in major/minor/patch notation.



                                For example version 30.20.48 would be written as 302048.
                                The way you have incremented it, the app is on version 3 right now. Try setting the versionCode as recommended and you should be fine.



                                Read More: config.xml - https://cordova.apache.org/docs/en/latest/config_ref/ Android



                                Platform Guide - https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code






                                share|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  As per cordova's documentation versioCode



                                  Expressed in major/minor/patch notation.



                                  For example version 30.20.48 would be written as 302048.
                                  The way you have incremented it, the app is on version 3 right now. Try setting the versionCode as recommended and you should be fine.



                                  Read More: config.xml - https://cordova.apache.org/docs/en/latest/config_ref/ Android



                                  Platform Guide - https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code






                                  share|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    As per cordova's documentation versioCode



                                    Expressed in major/minor/patch notation.



                                    For example version 30.20.48 would be written as 302048.
                                    The way you have incremented it, the app is on version 3 right now. Try setting the versionCode as recommended and you should be fine.



                                    Read More: config.xml - https://cordova.apache.org/docs/en/latest/config_ref/ Android



                                    Platform Guide - https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code






                                    share|improve this answer












                                    As per cordova's documentation versioCode



                                    Expressed in major/minor/patch notation.



                                    For example version 30.20.48 would be written as 302048.
                                    The way you have incremented it, the app is on version 3 right now. Try setting the versionCode as recommended and you should be fine.



                                    Read More: config.xml - https://cordova.apache.org/docs/en/latest/config_ref/ Android



                                    Platform Guide - https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 9 at 7:48









                                    Delwyn Pinto

                                    1388




                                    1388






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53209546%2ffastlane-and-ionic-android-apkupgradeversionconflict%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        這個網誌中的熱門文章

                                        Xamarin.form Move up view when keyboard appear

                                        Post-Redirect-Get with Spring WebFlux and Thymeleaf

                                        Anylogic : not able to use stopDelay()