Update CLI errors

Since I updated the Ionic cli, every time I add a plugin, I have to remove the platform and reinstall it. Anyone else with this?

cli packages: (/usr/local/lib/node_modules)

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

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.1.0
    Ionic Framework    : ionic-angular 3.9.2

What error do you get when adding the plugin without reinstalling the platform?

These are always the same mistakes, once the platform is removed and I add it again, it works correctly.

Build failed with an exception.


* What went wrong:

Task 'cdvBuildDebug' not found in root project 'android'.

* Try:

Run 
gradlew tasks to get a list of available tasks. Run with 
--stacktrace
 option to get the stack trace. Run with --info
 or 
--debug
 option to get more log output.

BUILD FAILED
 in 2s
(node:1208) UnhandledPromiseRejectionWarning: Error: /Users/nicolas/Documents/Proyectos/ProyectoIsapre/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

And

(node:1208) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

Do you use any hooks or did you change anything in your platform/android folder?

What command are you using to install the plugin?

Nothing changed, and for example, to install the plugins I use

$ ionic cordova plugin add cordova-plugin-firebase
$ npm install --save @ionic-native/firebase

I installed android@7.1.0 to my project, builded it and added the plugin. I got no errors. What android studio and gradle versions are you using? And what packages did you install with android sdk? You can output your installed packages to your console on mac with
$ANDROID_HOME/tools/bin/sdkmanager --list
or on windows with
%ANDROID_HOME%/tools/bin/sdkmanager --list

From what version of the CLI did you upgrade from?
Did you only update Ionic CLI or did you also update Cordova and the Cordova Android platform?

Update the client, cordova as I showed previously I have the version 8.0.0 and Android I have android 7.1.0

I could not post everything, exceeds the character limit

Path                                                                              | Version | Description                                     | Location                                                                          
  -------                                                                           | ------- | -------                                         | -------                                                                           
  build-tools;26.0.2                                                                | 26.0.2  | Android SDK Build-Tools 26.0.2                  | build-tools/26.0.2/                                                               
  build-tools;27.0.3                                                                | 27.0.3  | Android SDK Build-Tools 27.0.3                  | build-tools/27.0.3/                                                               
  emulator                                                                          | 27.1.12 | Android Emulator                                | emulator/                                                                         
  extras;android;m2repository                                                       | 47.0.0  | Android Support Repository                      | extras/android/m2repository/                                                      
  extras;google;m2repository                                                        | 58      | Google Repository                               | extras/google/m2repository/                                                       
  extras;intel;Hardware_Accelerated_Execution_Manager                               | 6.2.1   | Intel x86 Emulator Accelerator (HAXM installer) | extras/intel/Hardware_Accelerated_Execution_Manager/                              
  extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2 | 1       | Solver for ConstraintLayout 1.0.2               | extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2/
  extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2        | 1       | ConstraintLayout for Android 1.0.2              | extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2/       
  patcher;v4                                                                        | 1       | SDK Patch Applier v4                            | patcher/v4/                                                                       
  platform-tools                                                                    | 27.0.1  | Android SDK Platform-Tools                      | platform-tools/                                                                   
  platforms;android-18                                                              | 3       | Android SDK Platform 18                         | platforms/android-18/                                                             
  platforms;android-19                                                              | 4       | Android SDK Platform 19                         | platforms/android-19/                                                             
  platforms;android-20                                                              | 2       | Android SDK Platform 20                         | platforms/android-20/                                                             
  platforms;android-21                                                              | 2       | Android SDK Platform 21                         | platforms/android-21/                                                             
  platforms;android-22                                                              | 2       | Android SDK Platform 22                         | platforms/android-22/                                                             
  platforms;android-23                                                              | 3       | Android SDK Platform 23                         | platforms/android-23/                                                             
  platforms;android-24                                                              | 2       | Android SDK Platform 24                         | platforms/android-24/                                                             
  platforms;android-25                                                              | 3       | Android SDK Platform 25                         | platforms/android-25/                                                             
  platforms;android-26                                                              | 2       | Android SDK Platform 26                         | platforms/android-26/                                                             
  platforms;android-27                                                              | 1       | Android SDK Platform 27                         | platforms/android-27/                                                             
  sources;android-18                                                                | 1       | Sources for Android 18                          | sources/android-18/                                                               
  sources;android-19                                                                | 2       | Sources for Android 19                          | sources/android-19/                                                               
  sources;android-20                                                                | 1       | Sources for Android 20                          | sources/android-20/                                                               
  sources;android-21                                                                | 1       | Sources for Android 21                          | sources/android-21/                                                               
  sources;android-22                                                                | 1       | Sources for Android 22                          | sources/android-22/                                                               
  sources;android-23                                                                | 1       | Sources for Android 23                          | sources/android-23/                                                               
  sources;android-24                                                                | 1       | Sources for Android 24                          | sources/android-24/                                                               
  sources;android-25                                                                | 1       | Sources for Android 25                          | sources/android-25/                                                               
  sources;android-26                                                                | 1       | Sources for Android 26                          | sources/android-26/                                                               
  sources;android-27                                                                | 1       | Sources for Android 27                          | sources/android-27/                                                               
  system-images;android-27;google_apis_playstore;x86                                | 3       | Google Play Intel x86 Atom System Image         | system-images/android-27/google_apis_playstore/x86/                               
  tools                                                                             | 26.1.1  | Android SDK Tools                               | tools/                                                                            

Available Packages:
  Path                                                                                     | Version      | Description                                                         
  -------                                                                                  | -------      | -------                                                             
  add-ons;addon-google_apis-google-15                                                      | 3            | Google APIs                                                         
  add-ons;addon-google_apis-google-16                                                      | 4            | Google APIs                                                         
  add-ons;addon-google_apis-google-17                                                      | 4            | Google APIs                                                         
  add-ons;addon-google_apis-google-18                                                      | 4            | Google APIs                                                         
  add-ons;addon-google_apis-google-19                                                      | 20           | Google APIs                                                         
  add-ons;addon-google_apis-google-21                                                      | 1            | Google APIs                                                         
  add-ons;addon-google_apis-google-22                                                      | 1            | Google APIs                                                         
  add-ons;addon-google_apis-google-23                                                      | 1            | Google APIs                                                         
  add-ons;addon-google_apis-google-24                                                      | 1            | Google APIs                                                         
  add-ons;addon-google_gdk-google-19                                                       | 11           | Glass Development Kit Preview                                       
  build-tools;19.1.0                                                                       | 19.1.0       | Android SDK Build-Tools 19.1                                        
  build-tools;20.0.0                                                                       | 20.0.0       | Android SDK Build-Tools 20                                          
  build-tools;21.1.2                                                                       | 21.1.2       | Android SDK Build-Tools 21.1.2                                      
  build-tools;22.0.1                                                                       | 22.0.1       | Android SDK Build-Tools 22.0.1                                      
  build-tools;23.0.1                                                                       | 23.0.1       | Android SDK Build-Tools 23.0.1                                      
  build-tools;23.0.2                                                                       | 23.0.2       | Android SDK Build-Tools 23.0.2                                      
  build-tools;23.0.3                                                                       | 23.0.3       | Android SDK Build-Tools 23.0.3                                      
  build-tools;24.0.0                                                                       | 24.0.0       | Android SDK Build-Tools 24                                          
  build-tools;24.0.1                                                                       | 24.0.1       | Android SDK Build-Tools 24.0.1                                      
  build-tools;24.0.2                                                                       | 24.0.2       | Android SDK Build-Tools 24.0.2                                      
  build-tools;24.0.3                                                                       | 24.0.3       | Android SDK Build-Tools 24.0.3                                      
  build-tools;25.0.0                                                                       | 25.0.0       | Android SDK Build-Tools 25                                          
  build-tools;25.0.1                                                                       | 25.0.1       | Android SDK Build-Tools 25.0.1                                      
  build-tools;25.0.2                                                                       | 25.0.2       | Android SDK Build-Tools 25.0.2                                      
  build-tools;25.0.3                                                                       | 25.0.3       | Android SDK Build-Tools 25.0.3                                      
  build-tools;26.0.0                                                                       | 26.0.0       | Android SDK Build-Tools 26                                          
  build-tools;26.0.1                                                                       | 26.0.1       | Android SDK Build-Tools 26.0.1                                      
  build-tools;26.0.2                                                                       | 26.0.2       | Android SDK Build-Tools 26.0.2                                      
  build-tools;26.0.3                                                                       | 26.0.3       | Android SDK Build-Tools 26.0.3                                      
  build-tools;27.0.0                                                                       | 27.0.0       | Android SDK Build-Tools 27                                          
  build-tools;27.0.1                                                                       | 27.0.1       | Android SDK Build-Tools 27.0.1                                      
  build-tools;27.0.2                                                                       | 27.0.2       | Android SDK Build-Tools 27.0.2                                      
  build-tools;27.0.3                                                                       | 27.0.3       | Android SDK Build-Tools 27.0.3                                      
  build-tools;28.0.0-rc1                                                                   | 28.0.0 rc1   | Android SDK Build-Tools 28-rc1                                      
  cmake;3.6.4111459                                                                        | 3.6.4111459  | CMake 3.6.4111459                                                   
  docs                                                                                     | 1            | Documentation for Android SDK                                       
  

Looks fine to me, i have a similar output:

Path                                                | Version | Description                                     | Location
  -------                                             | ------- | -------                                         | -------
  build-tools;26.0.3                                  | 26.0.3  | Android SDK Build-Tools 26.0.3                  | build-tools/26.0.3/
  emulator                                            | 27.1.12 | Android Emulator                                | emulator/
  extras;android;m2repository                         | 47.0.0  | Android Support Repository                      | extras/android/m2repository/
  extras;google;m2repository                          | 58      | Google Repository                               | extras/google/m2repository/
  extras;intel;Hardware_Accelerated_Execution_Manager | 6.2.1   | Intel x86 Emulator Accelerator (HAXM installer) | extras/intel/Hardware_Accelerated_Execution_Manager/
  patcher;v4                                          | 1       | SDK Patch Applier v4                            | patcher/v4/
  platform-tools                                      | 27.0.1  | Android SDK Platform-Tools                      | platform-tools/
  platforms;android-26                                | 2       | Android SDK Platform 26                         | platforms/android-26/
  system-images;android-26;google_apis;x86            | 8       | Google APIs Intel x86 Atom System Image         | system-images/android-26/google_apis/x86/
  tools                                               | 26.1.1  | Android SDK Tools                               | tools/

So you used Cordova 8.0.0 and android 7.1.0 already with the previous ionic cli version and
the only thing you changed was ionic cli update, right?

Exactly, after the update started with the problems. I also happened to install the FCM plugin, delete it and always in the logs I have:

FCMPlugin.js: is created
FCMPlugin.js:41 FCMPlugin Ready ERROR

Have you tried to delete your node_modules folder and use npm i to reinstall it?

The truth is that no, the project has Login with Facebook and push notifications with Firebase, it cost me like 1 full night to understand that eliminating the platform worked, do you think that if I delete the folder, the problem is solved? or is it a path just?

It is only an idea. I don’t know if it works. I could not reproduce your error and found no similar error on google, so I can only guess how to solve the problem.