Проект React-Native случайно начал давать сбой
Причина: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: не удалось найти метод exec( ) для аргументов [ReactNativeModules$_getCommandOutput_closure16@45d8ac1c] объекта типа org.gradle.api.internal.provider.DefaultProviderFactory_Decorated.
при запуске пряжи android< /code>
Запускается JS-сервер
запускается эмулятор, затем происходит сбой
Мы ничего не меняли в gradle, и все версии упомянуто.
Исходная ошибка CLI
Произошла проблема при выполнении сценария.
Не удалось найти метод exec( ) для аргументов [ReactNativeModules$_getCommandOutput_closure16@2763a6b8] объекта типа org.gradle.api.internal.provider.DefaultProviderFactory_Decorated.
Путь/пакет, где произошла ошибка происходит
node_modules/@react-native-community/cli-platform-android/native_modules.gradle
Точный фрагмент кода, в котором произошла ошибка
/**
* Runs a specified command using providers.exec in a specified directory.
* Throws when the command result is empty.
*/
String getCommandOutput(String[] command, File directory) {
try {
def execOutput = providers.exec { // the error is occuring here
commandLine(command)
workingDir(directory)
}
def output = execOutput.standardOutput.asText.get().trim()
if (!output) {
this.logger.error("${LOG_PREFIX}Unexpected empty result of running '${command}' command.")
def error = execOutput.standardError.asText.get().trim()
throw new Exception(error)
}
return output
} catch (Exception exception) {
this.logger.error("${LOG_PREFIX}Running '${command}' command failed.")
throw exception
}
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... uild-error