typescript - Ionic 4 图像选择器崩溃 android 应用程序
问题描述
我正在使用离子图像选择器来选择多个图像并上传到 Firestore 存储。但是插件 cordova 图像选择器正在使我的 android 应用程序崩溃。我看到了一个教程并做了一个 poc。插件在 poc 中运行良好。但是当我在我的应用程序中实现它时它崩溃了。我坚持了一个多星期。请任何人帮助我解决工作。
alert('hello')
this.images = [];
var options = {
maximumImagesCount: 3,
outputType: 1
}
this.imagePicker.getPictures(options).then(async (results) => {
alert('Image URI: ');
for (var i = 0; i < results.length; i++) {
this.base64Image = 'data:image/jpg;base64,' + results[i];
}
(err) => {
// // Handle error
}
}).catch(err => {
alert('hello'+err)
})
解决方案
安装cordova插件:
命令:-cordova插件添加cordova-android-support-gradle-release2.删除平台:
命令:- Ionic cordova platform rm android3.添加平台:
命令:- ionic cordova platform add android@8.0.04.构建项目:
命令:- ionic cordova build android在 android 平台版本 8.0.0 上测试正常
推荐阅读
- java - 从 maven 项目中的 application.properties 中删除未使用的属性。如何验证删除的属性是未使用的
- ruby-on-rails - Webpacker 在 /app/public/packs/manifest.json 中找不到 application.css
- amazon-web-services - 将数据从 dynamodb 发送到 s3 时,AWS Glue 作业书签不起作用
- java - 带有 Java 驱动程序的 MongodDB:如何查找嵌套属性以及如何使用“和”运算符
- php - 验证访问令牌并将下载重定向到另一台服务器
- java - 在 Avro 中提供 Enum 演化向后兼容性的任何选项?
- python - 如何将列表元素中的参数提供给类?
- assembly - 逆向汇编简码结构问题
- swift - 如何在 macOS 上使用 SwiftUI 2 禁用全屏按钮
- c# - 如何在 ASP.NET Core 5 中的 IdentityUser 和 IdentityRole 之间使用隐式多对多