任务执行失败':calculator:compileKonanKotlinArithmeticParserIphone'

时间:2017-12-07 07:27:04

标签: ios kotlin kotlin-native

好吧,我尝试从kotlin-native repo运行Calculator示例。

按照以下步骤操作:

要构建并运行该示例,请执行以下操作:

  1. 使用Xcode打开samples / calculator / calculator.xcodeproj。

  2. 通过项目导航器打开项目的目标,转到选项卡 '一般&#39 ;.在身份' section将bundle ID更改为 反向DNS格式的唯一字符串。然后选择团队 '签名'部分。查看Xcode。更多信息的文档。

  3. 现在使用Xcode在连接的iPhone上构建并运行应用程序。

  4. 但是当我尝试在Xcode中构建应用程序时,我收到以下错误,其日志如下:

    ... ... ...

    The target is not enabled on the current host: linux . 
    Target 'linux' of artifact 'libgit2' is not supported on the current host . 
    The target is not enabled on the current host: linux . 
    The target is not enabled on the current host: linux . 
    The target is not enabled on the current host: linux . 
    The target is not enabled on the current host: linux  
    Target 'linux' of artifact 'libcurl' is not supported on the current host . 
    The target is not enabled on the current host: linux . 
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: raspberrypi
    Target 'linux' of artifact 'sdl' is not supported on the current host
    Target 'raspberrypi' of artifact 'sdl' is not supported on the current host
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: raspberrypi
    Target 'linux' of artifact 'tetris' is not supported on the current host
    Target 'raspberrypi' of artifact 'tetris' is not supported on the current host
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: mingw
    Target 'linux' of artifact 'ffmpeg' is not supported on the current host
    Target 'mingw' of artifact 'ffmpeg' is not supported on the current host
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: mingw
    Target 'linux' of artifact 'sdl' is not supported on the current host
    Target 'mingw' of artifact 'sdl' is not supported on the current host
    The target is not enabled on the current host: linux
    The target is not enabled on the current host: mingw
    Target 'linux' of artifact 'Player' is not supported on the current host
    Target 'mingw' of artifact 'Player' is not supported on the current host
    The target is not enabled on the current host: mingw
    :calculator:checkKonanCompiler
    :calculator:compileKonanKotlinArithmeticParserIphone FAILED
    
    FAILURE: Build failed with an exception.
    
    What went wrong:
    Execution failed for task ':calculator:compileKonanKotlinArithmeticParserIphone'.
    Classpath of the tool is empty: konanc
    Probably the 'konan.home' project property contains an incorrect path.
    Please change it to the compiler root directory and rerun the build.
    Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    Get more help at https://help.gradle.org
    
    BUILD FAILED in 8s
    2 actionable tasks: 2 executed
    Command /bin/sh failed with exit code 1
    

    谢谢!

1 个答案:

答案 0 :(得分:1)

我遇到了一个非常相似/相同的问题,以及Kotlin folks figured out the issue

  1. cdkotlin-native项目根目录
  2. 运行./gradlew dist crossDist
  3. 打开Xcode并运行项目。
  4. calculator demo running on an iPhone 8 Plus