简体   繁体   English

为什么在 Android Studio 中尝试构建 cordova 应用程序时出现此错误

[英]Why do i get this error when trying to build cordova app in Android studio

I have installed the latest build-tools;我已经安装了最新的构建工具; 29.0.2. 29.0.2。 Still it says no build-tools installed仍然说没有安装构建工具

C:\Users\user\Downloads\android-studio-ide-\android-studio\bin\runnerw.exe C:\Users\user\AppData\Roaming\npm\cordova.cmd run android Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED) Subproject Path: CordovaLib Subproject Path: app C:\Users\user\Downloads\android-studio-ide-\android-studio\bin\runnerw.exe C:\Users\user\AppData\Roaming\npm\cordova.cmd 运行 android 检查 Java JDK 和 Android SDK 版本ANDROID_SDK_ROOT=undefined (推荐设置) ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED) 子项目路径:CordovaLib 子项目路径:app

Project evaluation failed including an error in afterEvaluate {}.项目评估失败,包括 afterEvaluate {} 中的错误。 Run with --stacktrace for details of the afterEvaluate {} error.使用 --stacktrace 运行以获取 afterEvaluate {} 错误的详细信息。

FAILURE: Build failed with an exception.失败:构建失败,出现异常。

  • Where: Script 'C:\Users\user\LagBus\platforms\android\CordovaLib\cordova.gradle' line: 68其中:脚本 'C:\Users\user\LagBus\platforms\android\CordovaLib\cordova.gradle' 行:68

  • What went wrong:什么地方出了错:

    Configure project:app A problem occurred evaluating project ':app'.配置项目:app 评估项目“:app”时出现问题。 No installed build tools found.未找到已安装的构建工具。 Install the Android build tools version 19.1.0 or higher.安装 Android 构建工具版本 19.1.0 或更高版本。

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.使用 --scan 运行以获得完整的见解。

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 16s C:\Users\user\LagBus\platforms\android\gradlew: Command failed with exit code 1 Error output: Project evaluation failed including an error in afterEvaluate {}. BUILD FAILED in 16s C:\Users\user\LagBus\platforms\android\gradlew: Command failed with exit code 1 错误输出:项目评估失败,包括 afterEvaluate {} 中的错误。 Run with --stacktrace for details of the afterEvaluate {} error.使用 --stacktrace 运行以获取 afterEvaluate {} 错误的详细信息。

FAILURE: Build failed with an exception.失败:构建失败,出现异常。

  • Where: Script 'C:\Users\user\LagBus\platforms\android\CordovaLib\cordova.gradle' line: 68其中:脚本 'C:\Users\user\LagBus\platforms\android\CordovaLib\cordova.gradle' 行:68

  • What went wrong: A problem occurred evaluating project ':app'.出了什么问题:评估项目“:app”时出现问题。

    No installed build tools found.未找到已安装的构建工具。 Install the Android build tools version 19.1.0 or higher.安装 Android 构建工具版本 19.1.0 或更高版本。

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.使用 --scan 运行以获得完整的见解。

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 16s Picked up _JAVA_OPTIONS: -Xmx1024M 16 秒内构建失败 拾取 _JAVA_OPTIONS:-Xmx1024M

It might be that you don't have the android tools configured in your PATH, so cordova can't find them.可能是你没有在 PATH 中配置 android 工具,所以cordova找不到它们。

So, check that, in your path you have access to the android build tools and even other Android development environment configurations.因此,请检查您是否可以在您的路径中访问 android 构建工具甚至其他 Android 开发环境配置。

This is an example of a problem similar to yours, and how to solve it: According to this: https://github.com/ionic-team/ionic/issues/13120这是一个类似于你的问题的例子,以及如何解决它:根据这个: https ://github.com/ionic-team/ionic/issues/13120

EDIT: you have your answer here编辑:你在这里有答案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在android studio中构建时,出现错误:app:processDebugResources - When build in android studio i get error :app:processDebugResources 尝试在android studio中进行调试时出现“会话'app':错误” - I get “Session 'app': Error” when trying to debugg in android studio 尝试使用SherlockListFragment时,为什么会出现“无法转换为android.app.Fragment”错误 - why do I get “cannot be cast to android.app.Fragment” error when trying to use SherlockListFragment 尝试在Android Studio中打开输入流时,为什么会收到未处理的错误异常? (代码发布在说明中) - Why do I get the error unhandeled exception when trying to open my inputstream in Android studio? (code posted in description) 尝试构建默认 Android Studio 应用程序时出错 - Error trying to build the default Android Studio app 当我尝试通过Android studio构建应用程序时,出现以下错误,表示Gradle任务连接超时 - When I try to build app by Android studio , I get the following error that the Gradle tasks connects timeout 为什么当我尝试打开我的 android studio 项目时会出现构建错误? - Why i get build error when i try to open my android studio project? 尝试构建项目时android studio中出现错误 - Error in android studio when trying to build the project 尝试在Android Studio中使用Gradle进行构建时出错 - Error when trying to build with Gradle in Android Studio 尝试使用自适应图标构建cordova 应用程序时出错 - Error when trying to build cordova app with adaptive icons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM