尝试在Mac上的Android模拟器上运行NativeScript应用程序的Gradle错误

时间:2019-06-28 02:58:02

标签: android macos gradle nativescript kinvey

我正在尝试使用tns run android

在android上运行nativescript应用

我总是收到gradle错误:

FAILURE: Build failed with an exception.

* Where:

Build file: 

'/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/bui
ld.gradle' line: 28

* What went wrong:

A problem occurred evaluating root project '`kinvey_nativescript_sdk`'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
   > Could not create service of type OutputFilesRepository using ExecutionServices.createOutputFilesRepository().`

我尝试了以下操作:

  1. 运行./gradlew --stacktrace,但出现此错误:
Caused by: org.gradle.cache.LockTimeoutException: Timeout waiting to lock 
execution history cache 
(/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/.gr
adle/5.1.1/executionHistory). It is currently in use by another Gradle 
instance.
Owner PID: unknown
Our PID: 50331
Owner Operation: unknown
Our operation: 
Lock file: 
/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/.gra
dle/5.1.1/executionHistory/executionHistory.lock
  1. 手动删除.lock文件,然后重新运行tns run android,但我再次遇到相同的错误

  2. 运行

chmod  R+x/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk

没有解决问题

该应用在ios模拟器上运行良好,但在android上运行不正常

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,似乎与this Gradle issue有关。

我发现here的解决方法是将项目移到主文件夹(〜)。