Skip to content

This is a test repo demonstrating the problem with the Capacitor CLI hard-coding the output APK name in the `cap run` command.

Notifications You must be signed in to change notification settings

davidgeary/hardcoded-apk

Repository files navigation

READ ME

This is a test repo demonstrating the problem with the Capacitor CLI hard-coding the output APK name in the cap run command. See issue #8040 in the Capacitor repository for more details.

Reproducing this issue

This project is created as follows:

ionic start myApp blank --type=angular-standalone --capacitor --no-git
cd myApp
npm install @capacitor/android
npx cap add android

Then add the following line to ~\android\app\build.gradle:

android {
    defaultConfig {
        ...
        archivesBaseName = "$applicationId-v$versionCode"
        ...

Finally, build the project and try to run it:

npx ng build --configuration=development && npx cap copy
npx cap run android

The last command now fails with the error:

× Deploying app-debug.apk to 28231FDH200GGJ - failed!
[error] Selected hardware device 28231FDH200GGJ
        Error: ENOENT: no such file or directory, open 'C:\Dvt\myApp\android\app\build\outputs\apk\debug\app-debug.apk'

About

This is a test repo demonstrating the problem with the Capacitor CLI hard-coding the output APK name in the `cap run` command.

Resources

Stars

Watchers

Forks