2016-09-07 122 views
0

我正在嘗試通過示例Groceries教程,並且iOS平臺上的一切都很順利,但是當我嘗試tns run android --emulator時,我收到一條Cannot read property 'targetNum' of undefined錯誤消息。無法讀取undefined屬性'targetNum'

如果我做./gradlew buildapk --debug我得到這些線路與錯誤:

23:35:07.082 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :processDebugResources FAILED 
23:35:07.083 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :processDebugResources (Thread[main,5,main]) completed. Took 0.45 secs. 
23:35:07.083 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 1.491 secs, idle: 0.011 secs 
23:35:07.089 [ERROR] [org.gradle.BuildExceptionReporter] 
23:35:07.090 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 
23:35:07.090 [ERROR] [org.gradle.BuildExceptionReporter] 
23:35:07.090 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 
23:35:07.090 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':processDebugResources'. 
23:35:07.090 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/opt/android-sdk/build-tools/23.0.3/aapt'' finished with non-zero exit value 1 
23:35:07.091 [ERROR] [org.gradle.BuildExceptionReporter] 
23:35:07.091 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 
23:35:07.091 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
23:35:07.092 [LIFECYCLE] [org.gradle.BuildResultLogger] 
23:35:07.092 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 

我已經運行tns doctor和驗證ANDROID_HOME變量。也升級到最新的核心模塊,並嘗試了一些cocoapods版本,因爲tns醫生一直在發送關於CocoaPods安裝不良的警告。

編輯:謝謝@dennis尋找解決方案。這是有,但我錯過了大淡藍色的警告框:

enter image description here

回答

1

你有沒有建立一個Android虛擬設備(AVD)?有可能是因爲沒有Android模擬器連接到這個錯誤。我能夠用沒有配置AVD的新鮮repo重現錯誤,但是在設置了一個tns run android --emulator後,我的工作很順利。

如果你沒有一個AVD設置,您可以使用Android Studio和本指南啓動和運行:https://developer.android.com/studio/run/managing-avds.html

+0

非常感謝丹尼斯。我想指責Telerik的文檔沒有在他們的教程中包括這個,但後來我再次檢查並注意到那裏有一個很大的淺藍色警告。 – zJorge

+0

@zJorge很高興你把它分類! –