You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by vladimir-kotikov <gi...@git.apache.org> on 2015/08/26 16:21:16 UTC

[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

GitHub user vladimir-kotikov opened a pull request:

    https://github.com/apache/cordova-android/pull/209

    CB-9557 Fixes apk install failure when switching from debug to release build

    This fixes [CB-9557](https://issues.apache.org/jira/browse/CB-9557) and probably [CB-8834](https://issues.apache.org/jira/browse/CB-8834)
    
    I've also caught the issue, described on SO (http://stackoverflow.com/questions/26794862/failure-install-failed-update-incompatible) which is resolved by this PR as well.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-android CB-9557

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/209.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #209
    
----
commit 05151049d08093ad61c6df815df463f2d0046278
Author: Vladimir Kotikov <v-...@microsoft.com>
Date:   2015-08-26T13:09:27Z

    CB-9557 Fixes apk install failure when switching from debug to release build

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/209#discussion_r38016661
  
    --- Diff: bin/templates/cordova/lib/device.js ---
    @@ -96,10 +96,15 @@ module.exports.install = function(target, buildResults) {
         }).then(function(resolvedTarget) {
             var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
             var launchName = appinfo.getActivityName();
    +        var pkgName = appinfo.getPackageName();
             console.log('Using apk: ' + apk_path);
    -        console.log('Installing app on device...');
    -        var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
    -        return exec(cmd, os.tmpdir())
    +        console.log('Uninstalling ' + pkgName + ' from device...');
    +        return exec('adb -s ' + resolvedTarget.target + ' uninstall ' + pkgName, os.tmpdir())
    --- End diff --
    
    No. Even if `adb uninstall` fails to uninstall an app, it exits with error code 0, and thus `exec` promise is always resolved in this case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/209#discussion_r37999874
  
    --- Diff: bin/templates/cordova/lib/device.js ---
    @@ -96,10 +96,15 @@ module.exports.install = function(target, buildResults) {
         }).then(function(resolvedTarget) {
             var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
             var launchName = appinfo.getActivityName();
    +        var pkgName = appinfo.getPackageName();
             console.log('Using apk: ' + apk_path);
    -        console.log('Installing app on device...');
    -        var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
    -        return exec(cmd, os.tmpdir())
    +        console.log('Uninstalling ' + pkgName + ' from device...');
    +        return exec('adb -s ' + resolvedTarget.target + ' uninstall ' + pkgName, os.tmpdir())
    --- End diff --
    
    Wouldn't uninstalling always cause a failure - especially on the first run?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/209#discussion_r38036422
  
    --- Diff: bin/templates/cordova/lib/device.js ---
    @@ -96,10 +96,15 @@ module.exports.install = function(target, buildResults) {
         }).then(function(resolvedTarget) {
             var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
             var launchName = appinfo.getActivityName();
    +        var pkgName = appinfo.getPackageName();
             console.log('Using apk: ' + apk_path);
    -        console.log('Installing app on device...');
    -        var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
    -        return exec(cmd, os.tmpdir())
    +        console.log('Uninstalling ' + pkgName + ' from device...');
    +        return exec('adb -s ' + resolvedTarget.target + ' uninstall ' + pkgName, os.tmpdir())
    --- End diff --
    
    Ah - A comment would help clarify that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-android/pull/209#issuecomment-136538097
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-android/pull/209


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9557 Fixes apk install failure wh...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/209#discussion_r38066504
  
    --- Diff: bin/templates/cordova/lib/device.js ---
    @@ -96,10 +96,15 @@ module.exports.install = function(target, buildResults) {
         }).then(function(resolvedTarget) {
             var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
             var launchName = appinfo.getActivityName();
    +        var pkgName = appinfo.getPackageName();
             console.log('Using apk: ' + apk_path);
    -        console.log('Installing app on device...');
    -        var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
    -        return exec(cmd, os.tmpdir())
    +        console.log('Uninstalling ' + pkgName + ' from device...');
    +        return exec('adb -s ' + resolvedTarget.target + ' uninstall ' + pkgName, os.tmpdir())
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org