ionic升级到3.0之后,在使用命令:ionic cordova build android或者ionic cordova emulate android会提示以下错误
2018-01-19 15:47
591 查看
gzgchzc博客最新更新地址:http://blog.gzvtc.cc/
报错的原因:
cordova在6.4.0(cordova-android在6.1.2)之后,会要求安装Gradle,基于Gradle来编译、打包android。(具体版本号有待考证,但是需要安装Gradle属实)
解决办法:
1、手动下载gradle
gradle-x.x-bin.zip (x.x代表版本)
根据需要下载某一版本
地址: (https://services.gradle.org/distributions)
我下载的是gradle-4.1
下载完成后,解压到任意文件夹下
2、添加环境变量
PATH=D:\gradle-4.1\bin
3、关闭cmd
4、打开cmd,输入gradle -v,查看是否安装成功
5、继续使用ionic cordova build android。
(node:4308) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec tion id: 1): CordovaError: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio (node:4308) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [15:09:32] lint finished in 4.67 s
报错的原因:
cordova在6.4.0(cordova-android在6.1.2)之后,会要求安装Gradle,基于Gradle来编译、打包android。(具体版本号有待考证,但是需要安装Gradle属实)
解决办法:
1、手动下载gradle
gradle-x.x-bin.zip (x.x代表版本)
根据需要下载某一版本
地址: (https://services.gradle.org/distributions)
我下载的是gradle-4.1
下载完成后,解压到任意文件夹下
2、添加环境变量
PATH=D:\gradle-4.1\bin
3、关闭cmd
4、打开cmd,输入gradle -v,查看是否安装成功
5、继续使用ionic cordova build android。
相关文章推荐
- 错误提示之(MVC3.0):HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确 MVC误设起始页
- Android studio升级3.0,提示“Error:Cannot choose between the following configurations of project”错误
- ionic3添加android平台使用指定版本(解决没有升级Android Studio3.0的时候添加平台过高报错)
- 错误提示之(MVC3.0):HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。
- Android 5.0以下,使用android studio 出现错误com.android.build.api.transform.TransformException:
- 错误提示之(MVC3.0):HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确 MVC误设起始页
- 执行ionic cordova build命令报- unable to find attribute android:fontVariationSettings and android:ttcInde
- ionic生成apk使用build命令(ionic build android)下载gradle-2.2.1-all.zip(或gradle-2.14.1-all.zip等版本)慢,解决方案
- ocx链接错误 Project : error PRJ0050: 未能注册输出。请尝试启用“每个用户的重定向”,或者用提升的权限从命令提示窗
- android从内部存储写入、安装apk提示解析包错误,或者提示Permission Denied,文件不可用解决办法
- 使用DOS中的DEL命令不能删除文件怎么办,错误提示Acess is Denied
- Android 3.0以前版本使用Fragment提示getFragmentManager is undefined
- Cocos2d-x 3.0 开发(十七)使用Cocos2d-x 3.0rc,一条命令打包Android
- 工具问题——android升级ADT22之后新建android项目提示R cannot be resolved to a variable
- Cocos2d-x 3.0 开发 使用Cocos2d-x 3.0rc,一条命令打包Android
- zookeeper使用命令zkServer.sh status时出现错误提示问题
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”
- Android 关于使用httpPost出现405错误提示(doPost 405)
- Android命令行启动程序-am命令的使用-纠正网上大部分资料的错误
- firefox提示 内容编码错误 无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式