[英]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. 最初,我使用的节点版本为4.5.0 cordova 6.0和离子版本为1.7.2,以构建应用程序。 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.
现在已经升级了所有工具(节点版本8.11.3,cordova版本8.0.0和ionic版本3.20.0)以升级android api级别。 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
. 我使用
cordova platform remove android
,当我尝试使用命令cordova platform add android
它会自动添加android 7.0.0
版本。 when i try cordova platform add android@8.0.0
it gives me the error. 当我尝试
cordova platform add android@8.0.0
它给了我错误。 I have installed android Sdk version 26. but i am not able to upgrade the api level. 我已经安装了Android SDK版本26。但是我无法升级api级。 please help.
请帮忙。
the error i am getting when try to upgrade 8.0.0 is 我在尝试升级8.0.0时遇到的错误是
$ 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.
$ cordova平台添加android@8.0.0运行命令:/home/ubuntu/git/webrino/webrino-ionic/hooks/before_platform_add/init_directories.js / home / ubuntu / git / webrino / webrino-ionic使用cordova-fetch for cordova -android@8.0.0(节点:20325)UnhandledPromiseRejectionWarning:CordovaError:无法获取平台cordova-android@8.0.0可能是连接问题,或者平台规格不正确。 Check your connection and platform name/version/URL.
检查您的连接和平台名称/版本/ URL。 Error: npm: Command failed with exit code 1 Error output: npm ERR!
错误:npm:命令失败,退出代码为1错误输出:npm ERR! code ETARGET npm ERR!
代码ETARGET npm ERR! notarget No matching version found for cordova-android@8.0.0 npm ERR!
notarget没有找到cordova-android@8.0.0 npm ERR的匹配版本! notarget In most cases you or one of your dependencies are requesting npm ERR!
notarget在大多数情况下,您或您的一个依赖项正在请求npm ERR! notarget a package version that doesn't exist.
notarget不存在的软件包版本。
npm ERR!
npm ERR! A complete log of this run can be found in: npm ERR!
可以在以下位置找到该运行的完整日志: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./home/ubuntu/.npm/_logs/2018-07-12T04_30_18_048Z-debug.log位于/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:312:25在_rejected(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:797:24)在/ usr / local / lib / node_modules / cordova / node_modules / cordova-lib / Promise.when(/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31)的Promise.promise.promiseDispatch(/ usr / local)上的node_modules / q / q.js:823:30 /lib/node_modules/cordova/node_modules/q/q.js:808:41)在/usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44在runSingle(/ usr / local /在process._tickCallback(内部)刷新时(/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13)lib / node_modules / cordova / node_modules / q / q.js:137:13) /process/next_tick.js:112:11)(节点:20325)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。 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().
引发此错误的原因可能是抛出了一个没有catch块的异步函数,或者是拒绝了一个.catch()无法处理的承诺。 (rejection id: 1) (node:20325) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated.
(拒绝ID:1)(节点:20325)[DEP0018] DeprecationWarning:已弃用未处理的承诺拒绝。 In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
将来,未处理的承诺拒绝将以非零退出代码终止Node.js进程。
Cordova-android version 7.XX is the latest Android package according to their website itself. 根据其网站本身,Cordova-android版本7.XX是最新的Android软件包。
I think what you're looking for is the equivalent android version. 我认为您正在寻找的是等效的android版本。 Installing android platform ~7.0.0 is the correct latest version you are looking for.
安装Android平台〜7.0.0是您要寻找的正确最新版本。
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.
Ionic v1与Ionic v3有很大的不同,并且许多事情已经更改,因此您需要先编辑代码,然后程序才能像以前一样工作。 Check out Ionic V1- V2 .
查看Ionic V1- V2 。 Upgrade to V2 before you upgrade to V3 as it makes things easier.
在升级到V3之前先升级到V2,因为它使事情变得更容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.