Android API21 tns 2.3.0
我正在尝试使用 nativescript-sdk-examples-ng 实现相机组件
实现代码后,我在运行应用程序时遇到此错误 -
tns livesync ios --device 7a3c131309432ebae1a483f134ec8a4f8cdeecf4 --watch
Your application will be deployed only on the device specified by the provided index or identifier. Executing before-prepare hook from /Users/mohit/work/Mobile/native/finly-ng/hooks/before-prepare/nativescript-dev-typescript.js Found peer TypeScript 2.0.3 app/pages/expensephoto/expense-photo.component.ts(2,28): error TS2307: Cannot find module 'image-asset'.
node_modules/nativescript-camera/nativescript-camera.d.ts(1,29): error TS2307: Cannot find module 'image-asset'.
TypeScript compiler failed with exit code 1
我该如何解决这个问题?
最佳答案
您所引用的示例应用使用的是 tns-core-modules@next,其中存在 image-asset 模块。该模块将在几天内与 NativeScript 2.4.0 一起正式发布。
与此同时,如果您想试验这个和其他未发布的功能,您可以像这样安装 tns-core-modules 的 @next。
tns plugin remove tns-core-modules
tns plugin add tns-core-modules@next
现在您的应用程序将有权访问图像 Assets 。
关于android - native 脚本 : : error TS2307: Cannot find module 'image-asset' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40358194/