android - native 脚本 : : error TS2307: Cannot find module 'image-asset'

标签 android ios nativescript angular2-nativescript

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/

相关文章:

android - 显示自定义时间选择器期间应用强制关闭

android - b 代表什么,b+sr+Latn 背后的语法是什么?

ios - 在设置 view.frame 之后设置 view.layer.anchorpoint 会使 View 闪烁

NativeScript:标签上的最大行数

nativescript - TabView 标题样式

angular - 如何在angular2 nativescript中按顺序从 ListView 行项中获取所有开关控件值

kitkat 中的 Android -RecyclerView

java - 未输入 ViewHolder 中的 OnClickListener

objective-c - 如何从弱属性中移除 KVO?

iOS - UIButton 操作的选择器中的硬编码值