I'm currently working on an cross-platform app. I'm using Quasar & Vue and Capacitor. My app is working well on desktop and is building 'fine'. But when I want to install it in my phone (or android emulator) it says 'App Not Installed Package Appears To Be Invalid'.
Here is the build log :
PS C:\Users\me\Documents\u\voyo-spa> quasar build -m capacitor -T android
.d88888b.
d88P" "Y88b
888 888
888 888 888 888 8888b. .d8888b 8888b. 888d888
888 888 888 888 "88b 88K "88b 888P"
888 Y8b 888 888 888 .d888888 "Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888 888 X88 888 888 888
"Y888888" "Y88888 "Y888888 88888P' "Y888888 888
Y8b
Build mode............. capacitor
Pkg quasar............. v2.14.3
Pkg @quasar/app-vite... v1.7.3
Pkg vite............... v2.9.17
Debugging.............. no
Publishing............. no
Packaging mode......... gradle
App • WAIT • Compiling of Capacitor UI with Vite in progress...
App • DONE • Capacitor UI compiled with success • 6446ms
UI files build summary:
╔══════════════════════════════════════╤═══════════╗
║ Asset │ Size ║
╟──────────────────────────────────────┼───────────╢
║ assets/api.a6511b54.js │ 0.57 KB ║
║ assets/axios.15eb79b5.js │ 0.24 KB ║
║ assets/axios.6b484fa5.js │ 29.25 KB ║
║ assets/ContactsPage.a77d4f30.js │ 0.38 KB ║
║ assets/CreateVisit.0ae386a3.js │ 2.65 KB ║
║ assets/ErrorNotFound.92c9e1e2.js │ 0.53 KB ║
║ assets/ForgottenPassword.0522cb9f.js │ 2.13 KB ║
║ assets/HomePage.da1f2c94.js │ 3.77 KB ║
║ assets/i18n.a47aece6.js │ 47.56 KB ║
║ assets/index.2f452545.js │ 115.02 KB ║
║ assets/LoginPage.eb20bc0a.js │ 5.09 KB ║
║ assets/ProfilPage.cd1cf1eb.js │ 2.49 KB ║
║ assets/QBtn.e998e959.js │ 16.27 KB ║
║ assets/QCard.c0beb4e5.js │ 1.14 KB ║
║ assets/QInput.4a7d5195.js │ 25.33 KB ║
║ assets/RegisterPage.35cc7392.js │ 1.93 KB ║
║ assets/rules.6f86d38b.js │ 2.75 KB ║
║ assets/ToolBarComponent.88d69250.js │ 25.39 KB ║
║ assets/web.f4c3ae26.js │ 0.66 KB ║
╟──────────────────────────────────────┼───────────╢
║ assets/index.c9c1fd31.css │ 197.21 KB ║
║ assets/LoginPage.8b133043.css │ 0.08 KB ║
╟──────────────────────────────────────┼───────────╢
║ index.html │ 0.59 KB ║
╚══════════════════════════════════════╧═══════════╝
App • Updated src-capacitor/package.json
App • Updated capacitor.config.json
App • Running "C:\Users\me\Documents\u\voyo-spa\src-capacitor\node_modules\@capacitor\cli\bin\capacitor sync android" in C:\Users\me\Documents\u\voyo-spa\src-capacitor
√ Copying web assets from www to android\app\src\main\assets\public in 351.45ms
√ Creating capacitor.config.json in android\app\src\main\assets in 10.62ms
√ copy android in 401.83ms
√ Updating Android plugins in 2.22ms
[info] Found 1 Capacitor plugin for android:
@capacitor/app@5.0.7
√ update android in 682.92ms
[info] Sync finished in 1.101s
App • Updated capacitor.config.json
App • Building Android app...
App • [sync] Running "./gradlew.bat assembleRelease" in C:\Users\me\Documents\u\voyo-spa\src-capacitor\android
> Configure project :app
WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.
> Configure project :capacitor-cordova-android-plugins
WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.
BUILD SUCCESSFUL in 9s
133 actionable tasks: 30 executed, 103 up-to-date
Build succeeded
Build mode............. capacitor
Pkg quasar............. v2.14.3
Pkg @quasar/app-vite... v1.7.3
Pkg vite............... v2.9.17
Debugging.............. no
Publishing............. no
Packaging mode......... gradle
Browser target......... es2019|edge88|firefox78|chrome87|safari13.1
=======================
Output folder.......... C:\Users\me\Documents\u\voyo-spa\dist\capacitor
Tip: "src-capacitor" is a Capacitor project folder, so everything you know
about Capacitor applies to it. Quasar CLI generates the UI content
for "src-capacitor/www" folder and then either opens the IDE or calls
the platform's build commands to generate the final packaged file.
Tip: Feel free to use Capacitor CLI ("yarn capacitor <params>" or
"npx capacitor <params>") or change any files in "src-capacitor", except
for the "www" folder which must be built by Quasar CLI.
I've already try to delete the app and rebuild it, change install device and android version 11 & MIUI14 (Android 13). Does anyone know where it might come from or any idea to install it ?
Edit : I've also try to uninstall and install my java/capacitor/gradle and redo a project from start. Still the same error.
I've found a way to solve this. I've sign the app and now I can install it without any issue. No Idea why I was able to install it before~
You can sign an .apk with a mobile app apk-signer
There is a explanation how to sign ana apk on linux in this answer