在我的第一个android构建之后,我遇到了这个问题;然后,在此之前,项目将在设备甚至仿真器中进行开发。错误也会在模拟器中发生。
我一直在研究。更新到NativeScript tns-android: 5.4.0
tns-core-modules: 5.4.3
nativescript-vue: 2.2.2
的当前最新版本,还更新Firebase插件nativescript-plugin-firebase: 9.0.1
。这不允许我继续该项目。此刻我对此感到非常沮丧。
Unable to apply changes on device: DEVICE####.
Error is: Cannot read property 'env' of undefined.
使用--log trace
显示
Will emit event liveSyncError with data { error:
{ Error: Command ./gradlew failed with exit code 1
at Errors.fail (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:126:28)
at Errors.failWithoutHelp (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:136:21)
at AndroidProjectService.<anonymous> (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:666:34)
at Generator.throw (<anonymous>)
at rejected (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:11:65)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
name: 'Exception',
message: 'Command ./gradlew failed with exit code 1',
stack: 'Error: Command ./gradlew failed with exit code 1\n at Errors.fail (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:126:28)\n at Errors.failWithoutHelp (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:136:21)\n at AndroidProjectService.<anonymous> (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:666:34)\n at Generator.throw (<anonymous>)\n at rejected (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:11:65)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:189:7)',
errorCode: 127,
suppressCommandHelp: true,
proxyAuthenticationRequired: false,
printOnStdout: undefined },
.
.
.
在此先感谢您的帮助,这完全阻碍了项目的发展。
答案 0 :(得分:0)
如果您尝试将nativescript-dev-webpack @ next与NativeScript CLI的最新正式版本(5.4.2)一起使用,则将出现此错误,因为它们彼此之间不兼容(为NativeScript 6.0版本做准备)。
如果您想使用nativescript-dev-webpack @ next,则还需要安装nativescript @ next。
希望这会有所帮助!