You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Terence Bandoian (JIRA)" <ji...@apache.org> on 2018/03/01 13:13:00 UTC

[jira] [Updated] (CB-13932) APK Not Copied to Visual Studio bin Directory

     [ https://issues.apache.org/jira/browse/CB-13932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Terence Bandoian updated CB-13932:
----------------------------------
    Description: 
With Visual Studio 2017 configured to use the globally installed Cordova CLI (8.0) instead of the version packaged with Visual Studio, debug APKs generated with cordova-android@7.1.0 are not copied to the project bin directory.

Debug APKs are written to: 
{code:java}
platforms/android/app/build/outputs/apk/debug/app-debug.apk
{code}
Visual Studio apparently expects APKs to be written to:
{code:java}
bin/Android/Debug/android-debug.apk{code}
This prevents initiatiation of a debug session on a device from within Visual Studio.

A simple after_build script such as the following: 
{code:java}
module.exports = function (ctx) {
    if (ctx.opts.platforms.indexOf('android') < 0) {
        return;
    }

    var fs = ctx.requireCordovaModule('fs'),
        path = ctx.requireCordovaModule('path');

    var src = path.join(
        ctx.opts.projectRoot,
        'platforms/android/app/build/outputs/apk/debug/app-debug.apk');

    var dst = path.join(
        ctx.opts.projectRoot,
        'bin/Android/Debug/android-debug.apk');

    fs.copyFileSync(src, dst);

    return 0;
};
{code}
is an effective work-around but the development experience would be improved if it wasn't necessary to expend the extra effort to determine the cause and implement a solution.

The most recent version of cordova-android that I know of where this is not necessary is 6.3.0.  I haven't tested 6.4.0 or 7.0.0.

  was:
With Visual Studio 2017 configured to use the globally installed Cordova CLI (8.0) instead of the version packaged with Visual Studio, debug APKs generated with cordova-android@7.1.0 are not copied to the project bin directory.

Debug APKs are written to:

 
{code:java}
platforms/android/app/build/outputs/apk/debug/app-debug.apk
{code}
Visual Studio apparently expects APKs to be written to:
{code:java}
bin/Android/Debug/android-debug.apk{code}
This prevents initiatiation of a debug session on a device from within Visual Studio.

A simple after_build script such as the following:

 
{code:java}
module.exports = function (ctx) {
    if (ctx.opts.platforms.indexOf('android') < 0) {
        return;
    }

    var fs = ctx.requireCordovaModule('fs'),
        path = ctx.requireCordovaModule('path');

    var src = path.join(
        ctx.opts.projectRoot,
        'platforms/android/app/build/outputs/apk/debug/app-debug.apk');

    var dst = path.join(
        ctx.opts.projectRoot,
        'bin/Android/Debug/android-debug.apk');

    fs.copyFileSync(src, dst);

    return 0;
};
{code}
is an effective work-around but the development experience would be improved if it wasn't necessary to expend the extra effort to determine the cause and implement a solution.

The most recent version of cordova-android that I know of where this is not necessary is 6.3.0.  I haven't tested 6.4.0 or 7.0.0.


> APK Not Copied to Visual Studio bin Directory
> ---------------------------------------------
>
>                 Key: CB-13932
>                 URL: https://issues.apache.org/jira/browse/CB-13932
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-android
>    Affects Versions: cordova-android-7.0.0
>         Environment: cordova@8.0
> cordova-android@7.1.0
> Visual Studio 2017
> Windows 10
>            Reporter: Terence Bandoian
>            Assignee: Joe Bowser
>            Priority: Minor
>
> With Visual Studio 2017 configured to use the globally installed Cordova CLI (8.0) instead of the version packaged with Visual Studio, debug APKs generated with cordova-android@7.1.0 are not copied to the project bin directory.
> Debug APKs are written to: 
> {code:java}
> platforms/android/app/build/outputs/apk/debug/app-debug.apk
> {code}
> Visual Studio apparently expects APKs to be written to:
> {code:java}
> bin/Android/Debug/android-debug.apk{code}
> This prevents initiatiation of a debug session on a device from within Visual Studio.
> A simple after_build script such as the following: 
> {code:java}
> module.exports = function (ctx) {
>     if (ctx.opts.platforms.indexOf('android') < 0) {
>         return;
>     }
>     var fs = ctx.requireCordovaModule('fs'),
>         path = ctx.requireCordovaModule('path');
>     var src = path.join(
>         ctx.opts.projectRoot,
>         'platforms/android/app/build/outputs/apk/debug/app-debug.apk');
>     var dst = path.join(
>         ctx.opts.projectRoot,
>         'bin/Android/Debug/android-debug.apk');
>     fs.copyFileSync(src, dst);
>     return 0;
> };
> {code}
> is an effective work-around but the development experience would be improved if it wasn't necessary to expend the extra effort to determine the cause and implement a solution.
> The most recent version of cordova-android that I know of where this is not necessary is 6.3.0.  I haven't tested 6.4.0 or 7.0.0.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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