我不是cordova / android专家。为我提供了构建步骤,以构建一些cordova项目。但是,他们在相当长的一段时间后停止工作。我正在使用旧的cordova 6.5.0为Android构建一个cordova项目。我不相信我已经更改了任何设置或库。我删除了android studio和android sdk,然后重新安装了它们。现在,我收到很多奇怪的错误,例如:
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 include path to valid SDK directory.
Error: Error
at /platforms/android/cordova/lib/check_reqs.js:313:19
at _fulfilled (XXX/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (XXX/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (XXX/platforms/android/cordova/node_modules/q/q.js:816:13)
at XXX/platforms/android/cordova/node_modules/q/q.js:877:14
at runSingle (XXX/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (XXX/platforms/android/cordova/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:95:7)
at process._tickCallback (internal/process/next_tick.js:161:9)
我确实有ANDROID_HOME:
/root/Android/Sdk
和$ PATH:
echo $PATH
/home/XXX/.sdkman/candidates/gradle/current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/lib/jvm/java-8-oracle/bin:/home/XXX/dev/tools/idea-IU-145.258.11/bin:/root/Android/Sdk/tools:/root/Android/Sdk/platform-tools:/home/XXX/.sdkman/candidates/gradle/4.4.1/bin
我尝试使用android studio进行构建,提供了各种版本的gradle,但我始终会遇到一些奇怪的错误。
我如何理解发生了什么?我应该使用哪个版本的库?
谢谢