IONIC - Task 'cdvBuildDebug' not found in root project 'android' - node.js

I am getting issue while trying to generate android build
Task 'cdvBuildDebug' not found in root project 'android'.
Please find below my ionic cordova information
cli packages: (/usr/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.9
Cordova Platforms : MyApplication android 7.0.0 browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.11.1
npm : 5.6.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : /home/user/Android/Sdk
Misc:
backend : pro
Let me know what's wrong with it
Thanks

got a work around to this
simply change buildscript in /android/build.gradle to this
buildscript {
repositories {
maven {
url "https://dl.bintray.com/android/android-tools"
}
}
}

Related

Getting compileSdkVersion is not specified. Please add it to build.gradle

Getting this error while building apk
A problem occurred configuring project ':app'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
In build.gradle already added
compileSdkVersion cordovaConfig.COMPILE_SDK_VERSION
Also in config.xml file added
Can anyone help me what's the issue
Ionic Info
Ionic:
Ionic CLI : 5.4.16 (C:\Users\anshi\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 5.9.4
#angular-devkit/build-angular : 12.1.4
#angular-devkit/schematics : 12.2.18
#angular/cli : 12.2.18
#ionic/angular-toolkit : 4.0.0
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 11.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 23 other plugins)
Utility:
cordova-res : 0.15.4
native-run (update available: 1.7.1) : 1.5.0
System:
Android SDK Tools : 26.1.1 (C:\Users\username\AppData\Local\Android\Sdk)
NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.18
OS : Windows 10
Install module
npm i #ionic/cordova-builders
Is the file present in your node_modules?
node_modules/#ionic/cordova-builders/package.json
have you added the builders with: ng add #ionic/cordova-builders as per docs? https://www.npmjs.com/package/#ionic/cordova-builders
I don't think this is related to your issue. But the newest version of build tools is 33. cordova-android 11 builds by default for target-SDK-32 I believe. build-tools 26 is for targetSDK-26. I think you should add the newer versions of build tools (or use a lower version of cordova-android)

Running Ionic project using specific Node version

I am trying to run an Ionic project using Node version 14.18.3
I am using Volta to set this version for this one particular project
To do this I ran this command:
volta pin node#14
If I navigate to my project and run node -v then I see 14.18.3
When I try and build my project it fails and gives me an error that indicates that my node version is not 14
If I run ionic info then I see the following output. This shows that my node version is 16.13.1
Question - where is 16.13.1 coming from? How do I get Ionic to run using node 14?
Ionic:
Ionic CLI : 6.18.1 (/Users/chris/.volta/tools/image/packages/#ionic/cli/lib/node_modules/#ionic/cli)
Ionic Framework : ionic-angular 3.9.3
#ionic/app-scripts : 3.2.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 9.0.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 17 other plugins)
Utility:
cordova-res : 0.15.4
native-run (update available: 1.5.0) : 0.3.0
System:
Android SDK Tools : 26.1.1 (/Users/chris/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v16.13.1 (/Users/chris/.volta/tools/image/node/16.13.1/bin/node)
npm : 8.2.0
OS : macOS Monterey
Xcode : Xcode 13.2.1 Build version 13C100

ionic Nothing happened after lint finished when build or run

I hope I can get a bit of a clue in here. I did my research but I cant find the answer. I saw two previous similar question with no answer also. The problem is: whenever I do:
ionic cordova run android
ionic cordova run ios
ionic cordova build android
ionic cordova build ios
the CLI stopped after “Lint finished”. No error, nothing.
Ionic serve can do fine in browser.
it is also happened when i started new default blank project so I know this is not project issue, but my environtment.
Below are output of ionic info:
Ionic:
ionic (Ionic CLI) : 4.2.1
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.1.9
Cordova:
cordova (Cordova CLI) : 5.0.0
Cordova Platforms : android 4.0.0, ios
Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.2.0, (and 10 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\myusername\AppData\Local\Android\Sdk)
NodeJS : v6.11.2 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Please give me idea where to look at. Is my node outdated or something?

ionic sqlite porter (plugin_not_installed)

I followed the tutorial on the link below to create an ionic prepopulated database app but I get plugin_not_installed error.
ionic prepopulated db tutorial.
Other forums advised uninstalling the plugin and the platform and reinstalling but to no avail after several tries and even creating new ionic projects.
Find attached images of my config.xml file and my ionic info.
console.warn: Install the SQLitePorter plugin: 'ionic cordova plugin add uk.co.workingedge.cordova.plugin.sqliteporter'
console.error:
******[plugin_not_installed error][2]
**************Error plugin_not_installed
plugin list in config.xml
Ionic Info:
cli packages: (MY_DIRECTORY\npm\node_modules)
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages: cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 5.6.0
OS : Windows 8.1
Environment Variables: ANDROID_HOME : not set
Misc: backend : pro
I called the native plugin within platform.ready in case someone wants to ask.
Thank you.
eventually my problem was that I was testing the app with "ionic serve -c" with Ionic DevApp which doesn't load native plugins.
My solution was to build the app to preferred platform (ios in my case) and test in Xcode and it works.

ionic package build android FAILED due to TypeError: Cannot read property 'length' of undefined

I just created a demo ionic project by ionic start conference, but when I tried to build the Android package, it tell me that TypeError: Cannot read property 'length' of undefined.
Then I tried to create another demo, ionic start blank, failed again.
ionic serve works all good and here is the information of ionic info
global packages:
#ionic/cli-utils : 1.1.2
Ionic CLI : 3.1.2
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-ionic-angular : 1.3.0
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.9.5
OS : macOS Sierra
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
Is there any dependency problem?
Use following command to build for android:
ionic cordova build android

Resources