简体   繁体   中英

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.

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.

Background:

I am writing a shared libray for android using Android NDK to make use of in the Unity Game Engine. I have had several iteration cycles where everything went as expected (that is a new build was created and being tested in 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. 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:

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).

A restart of both Android Studio and my computer also did not resolve the issue.

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.

I have merely overseen this, but am going to leave this question here In case anyone makes the same mistake.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM