本文介绍了ionic build android抛出"Uh oh!";更新cordova后出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过sudo npm install -g cordova

现在,我遇到了问题,每次我尝试使用ionic run android --device构建android应用时,我都会得到

Now i have the problem, that everytime when i try to build the android app with ionic run android --device i get

Error during processing of action! Attempting to revert...
ERROR running one or more of the platforms: TypeError: Uh oh!
Invalid Version: undefined
You may not have the required environment or OS to run this project

ionic build android

Error during processing of action! Attempting to revert...
Error: Uh oh!
Invalid Version: undefined

IOS运行正常,所以我认为这是android的问题?

IOS is working fine so i think it's a problem with android?

Android SDK Tools: 24.3.4
Android SDK Platform-tools: 23.0.1
Android SDK Build-tools: 23.0.2
SDK: Android 5.1.1 (API 22)

我的连击:

Cordova CLI: 5.4.1
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.7.0
ios-sim version: 4.1.1
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.1 Build version 7B91b

推荐答案

platforms文件夹中的文件'platforms.json'丢失.运行命令以删除平台并添加平台.

The file 'platforms.json' in the platforms folder is missing.Run the commands to remove platforms and add platforms.

$ cordova platform rm android
$ cordova platform add android

确认这对您有用.

这篇关于ionic build android抛出"Uh oh!";更新cordova后出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 10:24