I can't post code here. It's Ionic/React app. I'm trying to install app-debug.apk generated by Android Studio.
If not yet done you could try/check these common potential issues:
Signing Key Mismatch
Even a debug APK must be signed correctly. Try cleaning the project and rebuilding the APK
Conflicting Installed Version
If an older version is installed, uninstall it first
Wrong Package Name
Even if "set correctly," there could be a mismatch between config.xml, capacitor.config.ts, and AndroidManifest.xml
Corrupt APK
The APK might be incomplete or broken. Try rebuilding
Debug vs. Release Conflict
Trying to install a debug APK over a release version (or vice versa)
Since you are using Android Studio try
running the app directly from Android Studio instead of manually installing the APK.
That might give a clearer error message.