cordova 问题汇总

用chrome进行调试:html

https://jingyan.baidu.com/album/db55b609fde96d4ba30a2fa9.html?picindex=8android

http://rensanning.iteye.com/blog/2018417chrome

 

======华丽丽的分割线======windows

 

[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually. Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to incl de path to valid SDK directory.] ERROR building one of the platforms: Error: cmd: Command failed with exit codeapp

安装 android sdk,在 环境变量 -> 系统变量 中分别加入:gradle

ANDROID_HOME=E:\Program Files\adt-bundle-windows-x86_64-20131030\sdk ui

PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-toolsspa

 

======华丽丽的分割线======.net

 

Error: 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 Studiodebug

下载 gradle-4.1,解压到任意文件夹,在 环境变量 -> 系统变量 中的 Path 加入对应文件夹的位置,如:C:\gradle-4.1\bin\。

 

======华丽丽的分割线======

 

[Android SDK Platform 25].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements from one workstation to another, go t
o http://d.android.com/r/studio-ui/export-licenses.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l og output.

 

参考 http://blog.csdn.net/xlyrh/article/details/54667633

手动建立 licenses, 如今ANDROID_HOME文件夹下建立 licenses 文件夹,而后建立名为 android-sdk-licenses.txt 文件,写入 8933bad161af4178b1185d1a37fbf41ea5269c55,再去掉文件扩展名。

 

======华丽丽的分割线======

 

BUILD SUCCESSFUL in 26s

1 actionable task: 1 executed
Subproject Path: CordovaLib
Downloading https://services.gradle.org/distributions/gradle-3.3-all.zip

遇到这个一直下载不下来,下载不下来,下载不下来,就别等了,把它该成本地的就行了。

找到文件 ...\platforms\android\cordova\lib\builders\GradleBuilder.js

202行,将 ‘https\\://services.gradle.org/distributions/gradle-3.3-all.zip’ 修改成 ‘file:///C:\Users\MikeJia\Desktop\personal\cordova’

 

======华丽丽的分割线======

 

codova run android 不能正常启动安卓模拟器

若是以前同时安装过 visual studio 和 android studio ,那么系统可能存在两个安卓模拟器。须要手动修改环境变量,指向可用的 android sdk

 

======华丽丽的分割线======