NativeScript / NativeScript/plugins
[@nativescript/imagepicker] - app crashes on video selection that is unloaded to iCloud
未关闭
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 206
- 派生
- 123
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 1
描述
Using @nativescript/imagepicker
When I pick a video that's stored locally it works as expected but if the video is old and is unloaded to iCloud to save device's storage it crashes the app immediately with the following error:
authorizing...
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: The file couldn\M-b\M^@\M^Z\M-C\M^D\M-C\M-4t be opened.
at
_loop_2(file: src/webpack:/mitch/node_modules/@nativescript/imagepicker/index.ios.js:148:0)
at (file: src/webpack:/mitch/node_modules/@nativescript/imagepicker/index.ios.js:158:0)
at timer(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:2405:0)
at invokeTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:406:0)
at runTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:178:0)
at invokeTask(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:487:0)
at ZoneTask.invoke(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:476:0)
at data.args.<computed>(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:2385:0)
at invoke(file: src/webpack:/mitch/node_modules/@nativescript/core/timer/index.ios.js:54:0)
at invoke(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:372:0)
at runGuarded(file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:144:0)
at (file: src/webpack:/mitch/node_modules/zone.js/fesm2015/zone.js:128:0)
at TimerTargetImpl.tick(file: src/webpack:/mitch/node_modules/@nativescript/core/timer/index.ios.js:18:0)
and this is how I'm handling video selection:
if (result === "Add video") {
this.mediaType = "video";
let videoPicker = imagePickerPlugin.create({
mode: 'single',
mediaType: ImagePickerMediaType.Video
});
this.startVideoSelection(videoPicker);
}
---
startVideoSelection(videoPicker) {
videoPicker
.authorize()
.then(() => videoPicker.present())
.then((selection) => {
console.log('Selection done: ' + JSON.stringify(selection));
this.processVideo(selection);
})
.catch((err) => {
console.log(err);
// this.errorMessage = err;
});
}
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 stack trace 中确定的 @nativescript/imagepicker/index.ios.js 第 148-158 行附近开始,并复现选择已卸载到 iCloud 的视频。当该选择不再导致应用崩溃,并且失败通过 picker 流程得到处理时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ios, typescript
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 32/100