intellij-idea - 无法使用yeoman生成器Gradle + Kotlin生成新项目

标签 intellij-idea gradle kotlin yeoman-generator

我使用brew install Caskroom/cask/android-studio在Mac上安装了Android Studio

然后,我运行yo gradle-kotlin,并收到以下错误。如何使我的第一个Hello World工作?

谢谢

✔ /Volumes/Git/android/kotlin-hello-world 
10:53 $ yo gradle-kotlin

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |      Welcome to the      |
   `---------´   | incredible Gradle+Kotlin |
    ( _´U`_ )    |        generator!        |
    /___A___\    '--------------------------'
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

  Detecting installed Gradle version...
  Fetching latest Kotlin version from Maven Central...
✔ Fetched latest Kotlin version: 1.0.1-2
✔ Detected installed Gradle version: 2.12
? What's your project name? kotlin hello world
? What Gradle version would you like to use? 2.12
? What Kotlin version would you like to use? 1.0.1-2
? Do you want to use Kotlin Reflection? Yes
? Would you like to use IDEA Gradle plugin? Yes
identical .gitignore
identical src/main/kotlin/.gitkeep
identical src/test/kotlin/.gitkeep
identical build.gradle
identical gradle.properties
identical settings.gradle
  Executing 'gradle wrapper' command...

✔ Done executing 'gradle wrapper' command.
  Executing Gradle tasks: idea build
internal/child_process.js:298
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
  at exports._errnoException (util.js:856:11)
  at ChildProcess.spawn (internal/child_process.js:298:11)
  at Object.exports.spawn (child_process.js:362:9)
  at Function.spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn-async/index.js:13:18)
  at spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn/index.js:34:23)
  at GradleKotlinGenerator.spawnCommand (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/yeoman-generator/lib/actions/spawn_command.js:20:10)
  at ChildProcess.<anonymous> (/usr/local/lib/node_modules/generator-gradle-kotlin/generators/app/gradle-kotlin.coffee:78:8)
  at emitTwo (events.js:100:13)
  at ChildProcess.emit (events.js:185:7)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

最佳答案

我已经修好了。

这是生成器逻辑中特定于OSX的错误,这是一个相当愚蠢的错误:它错误地检测到平台并尝试调用./gradlew.bat,甚至没有意识到它是.bat文件,EACCES错误的原因实际上是此。 bat 没有+ x权限。只需将生成器更新为1.1.1,就可以了。

关于intellij-idea - 无法使用yeoman生成器Gradle + Kotlin生成新项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36518481/

相关文章:

android - 我无法在 Google Play 商店中更新 : Version error

java - 将身份验证凭据传递到gradle.properties

spring - gradle 无法推断布局错误

delegates - Kotlin 委托(delegate)更有趣

kotlin - RxJava 2 在单元测试中覆盖 IO 调度程序

android - 相当于 imageView 的文本

scala - SBT 0.10 和 IDEA 初学者指南

flutter - 尽管出现 "At least one platform must be selected"错误,我如何创建 flutter 项目?

intellij-idea - GO SDK的位置

java - IntelliJ maven项目导入问题