Can't deploy ionic app on android device

Hello everyone,
i was about to deploy my ionic app when i got a message that a new version of ionic is available so i accepted and its when it happens, the execution fails, the error message is so long it can’t fit here and this only happens when i try to execute it on my android phone, it works fine on the navigator.

the error text

What is your ionic info output?

$ ionic info

cli packages: (C:\Users\Hamza\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : not installed

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 7.1.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2


    Android SDK Tools : 25.2.5
    Node              : v8.9.1
    npm               : 5.5.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Android\android-sdk


    backend : pro

Is this true? What do you get on cordova -v?

$ cordova -v

now the cordova (Cordova CLI) : is returning 7.1.0

Please create a new project with ionic start and see if you can deploy this app to a device.

Package name: io.ionic.starter

Yes it worked !

That is good news and bad news:

  1. It’s not your system that is fucked, but your project somehow.
  2. I have no idea how to further debug this or even fix this :confused:

Try removing and re-adding the Android platform for your broken project.
Are you using many plugins?

I’m using the admob, facebook and splashscreen plugins, i think as long as it is already screwed i’ll just start another one instead of wasting time on trying to fix it … Thanks a lot @Sujan12 :smiley: i appreciate it !!

1 Like

Good luck. Let’s hope it doesn’t break again when you add those plugins back.

Hello @Sujan12, i started a new project and i installed the plugins that i need but when i used ionic cordova run android --livereload it still gives me the same errors, but when i use ionic serve it works just fine on the navigator i’m so confused :tired_face::tired_face:

That’s expected as ionic serve doesn’t do anything with Cordova.

What is the list of plugins you have installed? (ionic cordova plugin list)

try removing admob and try again. Problem with admob and everything play store related (I am looking at you InAppPurchase and InAppPurchase2 plugins) is that they move the aidl to another path. Check the issues with the github where the plugin is uploaded and see if there’s a fix.

i actually fixed the problem, the cordova facebook4 plugin isn’t compatible with cordova android 7 that i had installed so i installed android 6.4 instead and its working perfectly now thank you guys :smiley: !

1 Like