How can i update ionic app android api level to 26..?

Initially i was using node version 4.5.0 cordova 6.0 and ionic version 1.7.2 to build the app. now have upgraded all the tools (node version 8.11.3, cordova version 8.0.0 and ionic version 3.20.0) for upgrading the android api level. i removed android platform using cordova platform remove android and when i try to add android platform using command cordova platform add android it automatically adds version android 7.0.0. when i try cordova platform add android@8.0.0 it gives me the error. I have installed android Sdk version 26. but i am not able to upgrade the api level. please help.

the error i am getting when try to upgrade 8.0.0 is

$ cordova platform add android@8.0.0 Running command: /home/ubuntu/git/webrino/webrino-ionic/hooks/before_platform_add/init_directories.js /home/ubuntu/git/webrino/webrino-ionic Using cordova-fetch for cordova-android@8.0.0 (node:20325) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch platform cordova-android@8.0.0 Probably this is either a connection problem, or platform spec is incorrect. Check your connection and platform name/version/URL. Error: npm: Command failed with exit code 1 Error output: npm ERR! code ETARGET npm ERR! notarget No matching version found for cordova-android@8.0.0 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in: npm ERR!
/home/ubuntu/.npm/_logs/2018-07-12T04_30_18_048Z-debug.log at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:312:25 at _rejected (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:797:24) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:823:30 at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:808:41) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44 at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13) at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13) at process._tickCallback (internal/process/next_tick.js:112:11) (node:20325) 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) (node:20325) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

1 answer

  • answered 2018-07-12 07:25 jeff chef

    Cordova-android version 7.X.X is the latest Android package according to their website itself.


    I think what you're looking for is the equivalent android version. Installing android platform ~7.0.0 is the correct latest version you are looking for.

    Also, upgrading the tools itself is not the same as upgrading the application you built before. Ionic v1 is very different from Ionic v3 and many things have changed so you need to edit the code before the program will work like it did before. Check out Ionic V1- V2. Upgrade to V2 before you upgrade to V3 as it makes things easier.