2016-09-07 112 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很高兴你把它分类! –

相关问题