Debug work perfectly on android studio but Run app doesn't work

Hi all,

I have a client that request to build an Android aab to uploaded to google play.
However, Debug work perfectly on android studio but Run app doesn’t work.
I have tried to build both ./gradlew assembleRelease and ./gradlew assembleDebug and both not working!!
Only if I run debug through android studio the app works.


=> ionic info

[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package'
       
       Require stack:
       - /home/ahmed/.nvm/versions/node/v12.22.10/lib/node_modules/@ionic/cli/lib/project/index.js
       - /home/ahmed/.nvm/versions/node/v12.22.10/lib/node_modules/@ionic/cli/lib/index.js
       - /home/ahmed/.nvm/versions/node/v12.22.10/lib/node_modules/@ionic/cli/index.js
       - /home/ahmed/.nvm/versions/node/v12.22.10/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

   Ionic CLI                     : 6.19.0 (/home/ahmed/.nvm/versions/node/v12.22.10/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.2.2
   @angular-devkit/build-angular : 0.803.8
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 8.3.8
   @ionic/angular-toolkit        : 2.0.0

Capacitor:

   Capacitor CLI      : 2.2.0
   @capacitor/android : 2.2.0
   @capacitor/core    : 2.2.0
   @capacitor/ios     : not installed

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : not installed globally
   native-run  : 1.5.0

System:

   Android SDK Tools : 26.1.1 (/home/ahmed/Android/Sdk)
   NodeJS            : v12.22.10 (/home/ahmed/.nvm/versions/node/v12.22.10/bin/node)
   npm               : 6.14.16
   OS                : Linux 5.4

I think the problem is in here:

./gradlew assembleDebug

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
google-services.json not found, google-services plugin not applied. Push Notifications won't work

> Configure project :capacitor-cordova-android-plugins
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

BUILD SUCCESSFUL in 6s
81 actionable tasks: 2 executed, 79 up-to-date