Task 'wrapper' not found in root project 'android'

So it doesn’t re-install automatically. Well, we tried. Now you have to install manually again. :wink:

No problem, it is always worth trying :wink:.

Ok, feedback on the Ionic CLI issue:

Yep, definitely Cordova/Android issue. I would mess with the installed SDK, Cordova versions, and Cordova Android platform versions, preferring the latest versions. That generally clears up weird build errors for me.

So - play with gradle a bit. Something is strange there. Also look into cordova-android, maybe the Cordova people know more.

I talked to the Cordova guys about this:

my hypothesis is you are using a version of cordova-android that is older than 6.1, and android sdk tools that are v26 or newer

So here is how we get these:

  1. Android Tools version:

android --version
If it tells you it’s deprecated, you’re running the latest version (>= v26.x.x)
If it tells you the android command doesn’t exist, you’re one version behind (~ v25.2.3)
If it prints out a version number, you’re 2 or more versions behind (<= v25.2.2)

If you are >=26 then run sdkmanager --list in your Android SDK directory, subdirectory /tools/bin. At the end of the output you should something like this:

Available Updates:
  ID                         | Installed | Available
  -------                    | -------   | -------
  emulator                   | 26.0.0    | 26.0.3
  extras;google;m2repository | 46        | 47
  tools                      | 26.0.1    | 26.0.2
  1. And for the cordova-android version just run cordova platform list.

Please run these two commands and report back what you get. Thanks.

  • android --version:
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Invalid or unsupported command "--version"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk
[1]    23564 exit 2     ./android --version
  • sdkmanager --list:
tools/bin/sdkmanager --list                                                                                                                  ✓  332  21:04:44 
Installed packages:
  Path                              | Version      | Description                       | Location                         
  -------                           | -------      | -------                           | -------                          
  build-tools;25.0.3                | 25.0.3       | Android SDK Build-Tools 25.0.3    | build-tools/25.0.3/              
  cmake;3.6.3155560                 | 3.6.3155560  | CMake 3.6.3155560                 | cmake/3.6.3155560/               
  emulator                          | 26.0.3       | Android Emulator                  | emulator/                        
  extras;android;m2repository       | 47.0.0       | Android Support Repository        | extras/android/m2repository/     
  extras;google;g...e_play_services | 39           | Google Play services              | extras/google/g..._play_services/
  extras;google;m2repository        | 47           | Google Repository                 | extras/google/m2repository/      
  extras;google;webdriver           | 2            | Google Web Driver                 | extras/google/webdriver/         
  lldb;2.3                          | 2.3.3614996  | LLDB 2.3                          | lldb/2.3/                        
  ndk-bundle                        | 14.1.3816874 | NDK                               | ndk-bundle/                      
  patcher;v4                        | 1            | SDK Patch Applier v4              | patcher/v4/                      
  platform-tools                    | 25.0.5       | Android SDK Platform-Tools        | platform-tools/                  
  platforms;android-25              | 3            | Android SDK Platform 25           | platforms/android-25/            
  sources;android-25                | 1            | Sources for Android 25            | sources/android-25/              
  system-images;a...google_apis;x86 | 4            | Google APIs Intel x86 Atom Sys... | system-images/a...oogle_apis/x86/
  tools                             | 26.0.2       | Android SDK Tools                 | tools/                           

Available Packages:
  Path                              | Version      | Description                      
  -------                           | -------      | -------                          
  add-ons;addon-g..._apis-google-15 | 3            | Google APIs                      
  add-ons;addon-g..._apis-google-16 | 4            | Google APIs                      
  add-ons;addon-g..._apis-google-17 | 4            | Google APIs                      
  add-ons;addon-g..._apis-google-18 | 4            | Google APIs                      
  add-ons;addon-g..._apis-google-19 | 20           | Google APIs                      
  add-ons;addon-g..._apis-google-21 | 1            | Google APIs                      
  add-ons;addon-g..._apis-google-22 | 1            | Google APIs                      
  add-ons;addon-g..._apis-google-23 | 1            | Google APIs                      
  add-ons;addon-g..._apis-google-24 | 1            | Google APIs                      
  add-ons;addon-g...e_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   
  cmake;3.6.3155560                 | 3.6.3155560  | CMake 3.6.3155560                
  docs                              | 1            | Documentation for Android SDK    
  emulator                          | 26.0.3       | Android Emulator                 
  extras;android;gapid;1            | 1.0.3        | GPU Debugging tools              
  extras;android;gapid;3            | 3.1.0        | GPU Debugging tools              
  extras;android;m2repository       | 47.0.0       | Android Support Repository       
  extras;google;auto                | 1.1          | Android Auto Desktop Head Unit...
  extras;google;g...e_play_services | 39           | Google Play services             
  extras;google;m2repository        | 47           | Google Repository                
  extras;google;m...t_apk_expansion | 1            | Google Play APK Expansion library
  extras;google;market_licensing    | 1            | Google Play Licensing Library    
  extras;google;play_billing        | 5            | Google Play Billing Library      
  extras;google;simulators          | 1            | Android Auto API Simulators      
  extras;google;webdriver           | 2            | Google Web Driver                
  extras;m2reposi...ut-solver;1.0.0 | 1            | Solver for ConstraintLayout 1.0.0
  extras;m2reposi...er;1.0.0-alpha2 | 1            | com.android.support.constraint...
  extras;m2reposi...er;1.0.0-alpha3 | 1            | com.android.support.constraint...
  extras;m2reposi...er;1.0.0-alpha4 | 1            | com.android.support.constraint...
  extras;m2reposi...er;1.0.0-alpha5 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...er;1.0.0-alpha6 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...er;1.0.0-alpha7 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...er;1.0.0-alpha8 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...er;1.0.0-alpha9 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ver;1.0.0-beta1 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ver;1.0.0-beta2 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ver;1.0.0-beta3 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ver;1.0.0-beta4 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ver;1.0.0-beta5 | 1            | Solver for ConstraintLayout 1....
  extras;m2reposi...ut-solver;1.0.1 | 1            | Solver for ConstraintLayout 1.0.1
  extras;m2reposi...ut-solver;1.0.2 | 1            | Solver for ConstraintLayout 1.0.2
  extras;m2reposi...nt-layout;1.0.0 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...ut;1.0.0-alpha2 | 1            | com.android.support.constraint...
  extras;m2reposi...ut;1.0.0-alpha3 | 1            | com.android.support.constraint...
  extras;m2reposi...ut;1.0.0-alpha4 | 1            | com.android.support.constraint...
  extras;m2reposi...ut;1.0.0-alpha5 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...ut;1.0.0-alpha6 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...ut;1.0.0-alpha7 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...ut;1.0.0-alpha8 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...ut;1.0.0-alpha9 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...out;1.0.0-beta1 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...out;1.0.0-beta2 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...out;1.0.0-beta3 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...out;1.0.0-beta4 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...out;1.0.0-beta5 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...nt-layout;1.0.1 | 1            | ConstraintLayout for Android 1...
  extras;m2reposi...nt-layout;1.0.2 | 1            | ConstraintLayout for Android 1...
  lldb;2.0                          | 2.0.2558144  | LLDB 2.0                         
  lldb;2.1                          | 2.1.2852477  | LLDB 2.1                         
  lldb;2.2                          | 2.2.3271982  | LLDB 2.2                         
  lldb;2.3                          | 2.3.3614996  | LLDB 2.3                         
  ndk-bundle                        | 14.1.3816874 | NDK                              
  patcher;v4                        | 1            | SDK Patch Applier v4             
  platform-tools                    | 25.0.5       | Android SDK Platform-Tools       
  platforms;android-10              | 2            | Android SDK Platform 10          
  platforms;android-11              | 2            | Android SDK Platform 11          
  platforms;android-12              | 3            | Android SDK Platform 12          
  platforms;android-13              | 1            | Android SDK Platform 13          
  platforms;android-14              | 4            | Android SDK Platform 14          
  platforms;android-15              | 5            | Android SDK Platform 15          
  platforms;android-16              | 5            | Android SDK Platform 16          
  platforms;android-17              | 3            | Android SDK Platform 17          
  platforms;android-18              | 3            | Android SDK Platform 18          
  platforms;android-19              | 4            | Android SDK Platform 19          
  platforms;android-20              | 2            | Android SDK Platform 20          
  platforms;android-21              | 2            | Android SDK Platform 21          
  platforms;android-22              | 2            | Android SDK Platform 22          
  platforms;android-23              | 3            | Android SDK Platform 23          
  platforms;android-24              | 2            | Android SDK Platform 24          
  platforms;android-25              | 3            | Android SDK Platform 25          
  platforms;android-7               | 3            | Android SDK Platform 7           
  platforms;android-8               | 3            | Android SDK Platform 8           
  platforms;android-9               | 2            | Android SDK Platform 9           
  sources;android-15                | 2            | Sources for Android 15           
  sources;android-16                | 2            | Sources for Android 16           
  sources;android-17                | 1            | Sources for Android 17           
  sources;android-18                | 1            | Sources for Android 18           
  sources;android-19                | 2            | Sources for Android 19           
  sources;android-20                | 1            | Sources for Android 20           
  sources;android-21                | 1            | Sources for Android 21           
  sources;android-22                | 1            | Sources for Android 22           
  sources;android-23                | 1            | Sources for Android 23           
  sources;android-24                | 1            | Sources for Android 24           
  sources;android-25                | 1            | Sources for Android 25           
  system-images;a...ult;armeabi-v7a | 4            | ARM EABI v7a System Image        
  system-images;a...-10;default;x86 | 4            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 5            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 5            | Google APIs Intel x86 Atom Sys...
  system-images;a...ult;armeabi-v7a | 2            | ARM EABI v7a System Image        
  system-images;a...ult;armeabi-v7a | 4            | ARM EABI v7a System Image        
  system-images;a...15;default;mips | 1            | MIPS System Image                
  system-images;a...-15;default;x86 | 4            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 5            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 5            | Google APIs Intel x86 Atom Sys...
  system-images;a...ult;armeabi-v7a | 4            | ARM EABI v7a System Image        
  system-images;a...16;default;mips | 1            | MIPS System Image                
  system-images;a...-16;default;x86 | 5            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 5            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 5            | Google APIs Intel x86 Atom Sys...
  system-images;a...ult;armeabi-v7a | 5            | ARM EABI v7a System Image        
  system-images;a...17;default;mips | 1            | MIPS System Image                
  system-images;a...-17;default;x86 | 3            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 5            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 5            | Google APIs Intel x86 Atom Sys...
  system-images;a...ult;armeabi-v7a | 4            | ARM EABI v7a System Image        
  system-images;a...-18;default;x86 | 3            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 5            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 5            | Google APIs Intel x86 Atom Sys...
  system-images;a...ult;armeabi-v7a | 5            | ARM EABI v7a System Image        
  system-images;a...-19;default;x86 | 5            | Intel x86 Atom System Image      
  system-images;a...pis;armeabi-v7a | 27           | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 27           | Google APIs Intel x86 Atom Sys...
  system-images;a...-tv;armeabi-v7a | 3            | Android TV ARM EABI v7a System...
  system-images;a...;android-tv;x86 | 3            | Android TV Intel x86 Atom Syst...
  system-images;a...ult;armeabi-v7a | 4            | ARM EABI v7a System Image        
  system-images;a...-21;default;x86 | 4            | Intel x86 Atom System Image      
  system-images;a...;default;x86_64 | 4            | Intel x86 Atom_64 System Image   
  system-images;a...pis;armeabi-v7a | 19           | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 19           | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 19           | Google APIs Intel x86 Atom_64 ...
  system-images;a...-tv;armeabi-v7a | 1            | Android TV ARM EABI v7a System...
  system-images;a...;android-tv;x86 | 3            | Android TV Intel x86 Atom Syst...
  system-images;a...ult;armeabi-v7a | 2            | ARM EABI v7a System Image        
  system-images;a...-22;default;x86 | 5            | Intel x86 Atom System Image      
  system-images;a...;default;x86_64 | 5            | Intel x86 Atom_64 System Image   
  system-images;a...pis;armeabi-v7a | 13           | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 13           | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 13           | Google APIs Intel x86 Atom_64 ...
  system-images;a...-tv;armeabi-v7a | 3            | Android TV ARM EABI v7a System...
  system-images;a...;android-tv;x86 | 9            | Android TV Intel x86 Atom Syst...
  system-images;a...ear;armeabi-v7a | 6            | Android Wear ARM EABI v7a Syst...
  system-images;a...ndroid-wear;x86 | 6            | Android Wear Intel x86 Atom Sy...
  system-images;a...-23;default;x86 | 9            | Intel x86 Atom System Image      
  system-images;a...;default;x86_64 | 9            | Intel x86 Atom_64 System Image   
  system-images;a...pis;armeabi-v7a | 20           | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 20           | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 20           | Google APIs Intel x86 Atom_64 ...
  system-images;a...;android-tv;x86 | 10           | Android TV Intel x86 Atom Syst...
  system-images;a...fault;arm64-v8a | 7            | ARM 64 v8a System Image          
  system-images;a...ult;armeabi-v7a | 7            | ARM EABI v7a System Image        
  system-images;a...-24;default;x86 | 7            | Intel x86 Atom System Image      
  system-images;a...;default;x86_64 | 7            | Intel x86 Atom_64 System Image   
  system-images;a..._apis;arm64-v8a | 11           | Google APIs ARM 64 v8a System ...
  system-images;a...pis;armeabi-v7a | 11           | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 11           | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 11           | Google APIs Intel x86 Atom_64 ...
  system-images;a...s_playstore;x86 | 12           | Google Play Intel x86 Atom Sys...
  system-images;a...;android-tv;x86 | 3            | Android TV Intel x86 Atom Syst...
  system-images;a...ear;armeabi-v7a | 3            | Android Wear ARM EABI v7a Syst...
  system-images;a...ndroid-wear;x86 | 3            | Android Wear Intel x86 Atom Sy...
  system-images;a..._apis;arm64-v8a | 4            | Google APIs ARM 64 v8a System ...
  system-images;a...pis;armeabi-v7a | 4            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 4            | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 4            | Google APIs Intel x86 Atom_64 ...
  tools                             | 26.0.2       | Android SDK Tools                
done
  1. cordova platform list:
{}
Installed platforms:
  android 6.2.3
Available platforms: 
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  ubuntu ~4.3.4 (deprecated)
  webos ~3.7.0

Damn - this means you are on all the newest (and required) versions and it is still failing for you.

I think you should create an issue with Cordova about that here: https://issues.apache.org/jira/browse/CB/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel Include all the information I asked from you over this thread, the last few are most important for them.

Ok, one last try and idea: Run cordova requirements again if it recognizes everything right now.

Thank you for your perseverance :slight_smile:, cordova requirements outputs:

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-25
Gradle: installed /usr/share/gradle/bin/gradle

And unfortunately the error too is persevering… :disappointed:

Then off you go, create an issue over there :wink:

Issue created here ;).

2 Likes

I fixed this issue by upgrading Gradle to version 3.5, solution given by Fabio Fabbri, here.

2 Likes

Hm, what version did you have before?

It was the 1.4 one, it seems that it is the officially distributed for Ubuntu 14.04.

1 Like

Oh ok. So cordova requirements only checks if Gradle is installed, but not if it’s a new enough version.

Yeap, it seems to. Does the proposed solution work for you @Nikhil_dhar123 @mnofresno @azharevil?

Hii my problem is solved actually ut was not a big issue just in android studio gradle was missing and then I downloaded gradle and gave path to android studio and it works fine

Hello,

I am also getting following error.

ANDROID_HOME=/home/sanjeev/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle

FAILURE: Could not determine which tasks to execute.

* What went wrong:
Task 'wrapper' not found in root project 'android'.

* Try:
Run 
gradle tasks to get a list of available tasks.

BUILD FAILED


Total time: 6.281 secs
Error: /usr/share/gradle/bin/gradle: Command failed with exit code 1


[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[ERROR] An error occurred while running cordova run android (exit code 1).

ionic info output

cli packages: (/home/sanjeev/@Projects/MyIonicProject/cutePuppyPics/node_modules)

    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.3
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Android SDK Tools : 26.0.2
    Node              : v6.11.2
    OS                : Linux 3.19
    npm               : 3.10.10 

cordova platform list output

{}
Installed platforms:
  android 6.2.3
Available platforms: 
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  ubuntu ~4.3.4 (deprecated)
  webos ~3.7.0

This is my first Ionic project for learning.
Please help me.

Regards,

Run cordova requirements. All successful?
If yes, remove and then re-add the android platform.

Hi,

This is my cordova requirements output

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-25,android-24,android-23,Google Inc.:Google APIs:23,android-22,android-21,Google Inc.:Google APIs:21,android-19
Gradle: installed /usr/share/gradle/bin/gradle

Still no luck.

See the other part of my post: