gpt4 book ai didi

android - cordova-android ./create $( which android ) 以 1 退出

转载 作者:行者123 更新时间:2023-11-29 14:25:10 25 4
gpt4 key购买 nike

执行创建项目的命令后...

./create <PATH_TO_PROJECT_DIR> <COM_PATH> <PROJECT_NAME>

我收到错误信息:

An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...

故障排除响应:(acconrad 提供了一个智能 list here 用于解决 Cordova 错误...)

Did you download the correct version of PhoneGap from the correct LOCATION? It appears as if there are versions of PhoneGap that do not come packaged with Cordova-2.x.0.jar, which is necessary to run the script. Download here to obtain PhoneGap with the correct JAR file.

我已按照 official Apache Cordova API Documentation 中的说明进行操作网站并下载了 cordova-android repository from github .官方文档没有说明这个 jar 文件,因此我没有执行它。

Did you already create the folder? The documentation claims that you can use this command as long as the new folder is blank. This is not true. Make sure the folder does not exist before attempting to create the project.

全新文件夹路径,从未创建。

Do you have the latest version of Ant? You will need Ant 1.8.0 or greater to run PhoneGap with Android. Use ant -v to verify your version.

Ant 版本 1.8.2,虽然运行 -v 标志弹出以下输出...

Apache Ant(TM) version 1.8.2 compiled on June 3 2011
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

...好像它正在尝试构建。我假设 -v 表示详细并且 ant 正在尝试构建当前的 director,其中没有 build.xml 文件,因为我不是用 ant 构建项目,只是找到版本,它是 1.8.2。

Is your .bash_profile/Environment Varibles PATH set properly? The official documentation has been updated to reflect this, but you will absolutely need these variables set correctly in order to create the project.

两个 SDK 路径都已设置 & sourced.

Did you update the terminal to reflect your new PATHs? source .bash_profile or . .bash_profile in your currently open terminal window so your paths are updated when running the create command.

尚未重新启动,但 $PATH 输出正确的 android-sdk-macosx 路径(平台工具 && 工具)。

Do you have the correct commons-codec? You may receive an accompanying error referring to a missing commons-codec file, which you can download here.

未显示 commons-codec 伴随错误。

最佳答案

问题确实是 PATH 变量...

/PATH/TO/android-sdk-maxosx/platform-tools

/PATH/TO/android-sdk-maxosx/tools

从路径名中删除了 macosx。

在 ~/.bash_profile 中更正这些环境变量解决了这个问题。

关于android - cordova-android ./create $( which android ) 以 1 退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13767007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com