爱笑的小哥
爱笑的小哥
  • 发布:2023-05-25 12:04
  • 更新:2023-05-25 23:42
  • 阅读:202

【报Bug】cmr.captureImage拍照,plus.zip.compressImage压缩时提示文件不存在,云打包可以,离线资源打包 Android11以上不行

分类:HTML5+

产品分类: HTML5+

HBuilderX版本号: 3.7.12

手机系统: Android

手机系统版本号: Android 11

手机厂商: OPPO

手机机型: oppo

打包方式: 离线

示例代码:

//打包APP,cmr.captureImage进行相机拍照,根据决定路径去查找文件,发现图片大小为0kb,再通过plus.zip.compressImage压缩,提示文件不存在。

    var cmr = plus.camera.getCamera();    
var ts = (new Date()).getTime();    
var fileName = ts+".jpg"    
var pfsi = new PictureFSInfo(userId,cusId,type,fileName);    
var path = pfsi.getSourcePath();    
var bpath = pfsi.getBreviaryPath();    
    cmr.captureImage( function(capturedFile){    
        console.log( "Capture image success: " + capturedFile );      
        plus.zip.compressImage({    
                src:capturedFile,    
                dst:bpath,    
                quality:quality    
            }, function(event){    
                console.log('压缩成功');    
            }, function(e){    
                console.log('压缩失败');    
                mui.toast(JSON.stringify(e));    
            });    

    },    
    function( error ) {    
        console.log( "Capture image failed: " + error.message );    
        mui.toast('拍摄失败!'+error.message);    
    },     
    {format:'jpg',filename:path}    
);

操作步骤:

Android11以上出现

预期结果:

提供解决方案

实际结果:

提供解决方案

bug描述:

2023-05-25 12:04 负责人:无 分享
已邀请:
FullStack

FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866

配置 targetSdkVersion 低于 29 的看看

要回复问题请先登录注册