kaiven
kaiven
  • 发布:2023-05-28 16:22
  • 更新:2023-05-28 16:22
  • 阅读:187

【错误的提交】Android-SDK@3.8.3.81835_20230527 离线SDK无法打开摄像头

分类:MUI

产品分类: 其他/MUI

HBuilderX版本号: 3.8.3

手机系统: Android

手机系统版本号: Android 8.1

手机厂商: 商米

手机机型: FT2-G

打包方式: 离线

示例代码:

uni.chooseImage({
sourceType: sourceType[this.sourceTypeIndex],
sizeType: sizeType[this.sizeTypeIndex],
count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex],
success: (res) => {
this.imageList = this.imageList.concat(res.tempFilePaths);
},
fail: (err) => {
console.log("err: ",err);
// #ifdef APP-PLUS
if (err['code'] && err.code !== 0 && this.sourceTypeIndex === 2) {
this.checkPermission(err.code);
}
// #endif
// #ifdef MP
if(err.errMsg.indexOf('cancel') !== '-1'){
return;
}
uni.getSetting({
success: (res) => {
let authStatus = false;
switch (this.sourceTypeIndex) {
case 0:
authStatus = res.authSetting['scope.camera'];
break;
case 1:
authStatus = res.authSetting['scope.album'];
break;
case 2:
authStatus = res.authSetting['scope.album'] && res.authSetting['scope.camera'];
break;
default:
break;
}
if (!authStatus) {
uni.showModal({
title: '授权失败',
content: 'Hello uni-app需要从您的相机或相册获取图片,请在设置界面打开相关权限',
success: (res) => {
if (res.confirm) {
uni.openSetting()
}
}
})
}
}
})
// #endif
}
})
},

操作步骤:

uniapp 样例工程, 打开图片,选择拍摄

预期结果:

应该打开摄像头,进行拍摄和选择图片

实际结果:

摄像头无法打开和拍照

bug描述:

uniapp 样例工程
本地Hbuildx 和本地离线打包的版本
无法打开摄像头

2023-05-28 16:22 负责人:无 分享
已邀请:

要回复问题请先登录注册