简体   繁体   English

Android Studio NDK库项目:Gradle构建错误“指定的文件不存在”

[英]Android Studio NDK Library Project: Gradle Build Error “The Specified File does not exist”

SOLVED 解决了

Use the following command 使用以下命令

gradlew build [options]

Instead of 代替

gradlew -build [options]

It basically thought -build was the declaration of an option argument and not a call to the build task. 它基本上认为-build是一个选项参数的声明,而不是对构建任务的调用。

I have merely overseen this, but am going to leave this question here In case anyone makes the same mistake. 我只是监督这个,但我会在这里留下这个问题如果有人犯了同样的错误。

The Problem: 问题:

Gradle build process failed with IllegalArgumentException: The specified build file ' \\uild\u003c/strong> ' does not exist. Grale构建过程失败,出现IllegalArgumentException:指定的构建文件' \\ uild '不存在。

Background: 背景:

I am writing a shared libray for android using Android NDK to make use of in the Unity Game Engine. 我正在使用Android NDK编写一个用于Android的共享库,以便在Unity游戏引擎中使用。 I have had several iteration cycles where everything went as expected (that is a new build was created and being tested in Unity). 我有几个迭代周期,一切都按预期进行(这是一个新的构建创建并在Unity中测试)。 I have written some code over the last few days and even left my computer on over night. 我在过去的几天里写了一些代码,甚至把我的电脑留了一夜。

Today I return to the project and press the UI's "Build" (green hammer) button. 今天我回到项目并按下UI的“Build”(绿色锤子)按钮。 Everything seems to work, but the output files in my build directory are not updated. 一切似乎都有效,但我的构建目录中的输出文件不会更新。 I wonder what causes this isse and run the gradle build process via terminal using the following command: 我想知道是什么导致这个问题并使用以下命令通过终端运行gradle构建过程:

gradlew -build --debug --info --stacktrace

What happens: 怎么了:

The process starts and crashes, returning the following (relevant) log: 该过程启动并崩溃,返回以下(相关)日志:

22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] The specified build file 'E:\Android_Development\NDK_Libraries\UnityOboe\uild' does not exist.
22:09:43.479 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]

Everything before this seems to be unlrelated to this issue. 在此之前的一切似乎与此问题无关。

Notes 笔记

The only issue I found, that resembles my error most is related to a different project and has a completely different background as well. 我发现的唯一一个类似于我的错误的问题是与不同的项目有关,并且具有完全不同的背景。 Unfortunately I can't even provide any steps to reproduce this error. 不幸的是,我甚至无法提供任何重现此错误的步骤。

If there is the need for me to provide additional information (build files, etc.) I'll do so. 如果我需要提供额外的信息(构建文件等),我会这样做。 The problem is that I didn't change a thing except for some code in a .cpp file and tried to get a new build (I didn't even turn the computer of let alone close android studio). 问题是我没有改变除了.cpp文件中的一些代码之外的东西,并试图获得一个新的构建(我甚至没有关闭计算机,更不用说关闭android工作室了)。

A restart of both Android Studio and my computer also did not resolve the issue. 重新启动Android Studio和我的计算机也无法解决问题。

At this point I just can't draw any connections so I'm pretty lost. 在这一点上,我只是无法绘制任何连接,所以我很丢失。

Solution

Use the following command 使用以下命令

gradlew build [options]

Instead of 代替

gradlew -build [options]

It basically thought -build was the declaration of an option argument and not a call to the build task. 它基本上认为-build是一个选项参数的声明,而不是对构建任务的调用。

I have merely overseen this, but am going to leave this question here In case anyone makes the same mistake. 我只是监督这个,但我会在这里留下这个问题如果有人犯了同样的错误。

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

相关问题 将Android项目添加为库(SlidingMenu)[包不存在]的Gradle错误 - Gradle error with Android project added as a library (SlidingMenu) [package does not exist] 如何使用 Android Studio + Gradle + NDK 构建外部 C++ 库? - How to build external C++ library with Android Studio + Gradle + NDK? Android Studio:资源文件在库项目中不存在 - Android Studio: Resource file does not exist in library project Android NDK-Gradle构建错误 - Android NDK - Gradle Build Error Android Studio:新的gradle构建NDK示例应用程序错误 - Android Studio: New gradle build NDK sample app error Android Studio NDK不同的用户名-Gradle Build Error - Android Studio NDK different user name - Gradle Build Error 具有Appcompact库的Android Studio中的Gradle构建错误 - Gradle build error in android studio with appcompact library Android Studio:Gradle Build失败并显示错误:无法加载类'com.android.build.gradle.ndk.NdkPlugin' - Android Studio: Gradle Build fails with error: Unable to load class 'com.android.build.gradle.ndk.NdkPlugin' 在Android Studio gradle项目中使用NDK和STL - Using NDK with STL in Android Studio gradle project 更新Android Studio RC 2后出现Gradle Build错误-android-sdk-linux'不存在 - Gradle Build error after updating Android Studio RC 2 - android-sdk-linux' does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM