gpt4 book ai didi

ios - 在 iPad 上加载大于 256MB 的文件时应用程序崩溃

转载 作者:行者123 更新时间:2023-11-29 02:48:02 27 4
gpt4 key购买 nike

我无法理解应用程序崩溃的原因是什么。如果有人遇到同样的问题,请告诉我。

Cordova 3.5.0
插件版本:
文件传输 0.4.4
文件 1.2.0
InAppBrowse 0.5.0

iPad 2 版本 7.1.2
上传文件时出错 iOS > 256MB

日志设备:

Jul 21 18:17:01 iPad-Sergej MyApp[160] <Warning>: CDVWebViewDelegate: Navigation started when state=1
Jul 21 18:17:01 iPad-Sergej MyApp[160] <Warning>: Failed to load webpage with error: CDVWebViewDelegate: Navigation started when state=1
Jul 21 18:17:01 iPad-Sergej MyApp[160] <Warning>: THREAD WARNING: ['File'] took '68.479980' ms. Plugin should use a background thread.
Jul 21 18:17:01 iPad-Sergej MyApp[160] <Error>: MyApp(160,0x3b50818c) malloc: *** mach_vm_map(size=408289280) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Jul 21 18:17:01 iPad-Sergej MyApp[160] <Error>: *** Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle readDataOfLength:]: Cannot allocate memory'
*** First throw call stack:
(0x2e49af83 0x38f81ccf 0x2e49aec5 0x2ee49931 0x2ee49fe3 0xceee7 0xd1a8d 0xbcd09 0xbc9ff 0x2ee7b163 0x2e466167 0x2e465d7f 0x2e46411b 0x2e3ceebf 0x2e3ceca3 0x332c9663 0x30d1b14d 0xbffb7 0x3948eab7)
Jul 21 18:17:01 iPad-Sergej ReportCrash[161] <Notice>: ReportCrash acting against PID 160
Jul 21 18:17:02 iPad-Sergej ReportCrash[161] <Notice>: Formulating crash report for process MyApp[160]
Jul 21 18:17:02 iPad-Sergej mediaserverd[45] <Warning>: 18:17:02.266 [0x5ee000] CMSession retain count > 1!
Jul 21 18:17:02 iPad-Sergej com.apple.launchd[1] (UIKitApplication:com.MyApp[0xd3ac][160]) <Warning>: (UIKitApplication:com.MyApp[0xd3ac]) Job appears to have crashed: Abort trap: 6
Jul 21 18:17:02 iPad-Sergej backboardd[29] <Warning>: Application 'UIKitApplication:com.MyApp[0xd3ac]' exited abnormally with signal 6: Abort trap: 6
Jul 21 18:17:02 iPad-Sergej SpringBoard[33] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
Jul 21 18:17:02 iPad-Sergej ReportCrash[161] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/MyApp_2014-07-21-181701_iPad-Sergej.ips using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

代码函数上传:

function uploadVideo(meeting_id) {  
navigator.camera.getPicture(
successGetFileFromCamera,
failGetFileFromCamera,
{
quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: navigator.camera.MediaType.VIDEO
}
);

function successGetFileFromCamera(fileURI) {
uploadFileToServ(fileURI);
}

function uploadFileToServ(fileURI) {
window.resolveLocalFileSystemURL(fileURI, successGetFileFromLocal, failGetFileFromLocal);

function successGetFileFromLocal(fileEntry) {
fileEntry.file(successFile, failFile);
function successFile(fileObj) {
var localURL = fileObj.localURL,
fileName = fileObj.name;

var options = new FileUploadOptions();
options.fileKey = "my_video";
options.fileName = fileName;
options.mimeType="video/mp4";
var params = {};
params.meeting_id = meeting_id;
options.params = params;
options.chunkedMode = true;

var ft = new FileTransfer();
ft.onprogress = function(progressEvent) {
if(progressEvent.lengthComputable) {
updateProgress(Number(((progressEvent.loaded / progressEvent.total) * 100).toFixed(1)));
}
};
showProgress();

ft.upload(localURL, encodeURI(window.host + "/myserver/mobile/uploadFile/t:" + window.Token), successUploadFileToServ, failUploadFileToServ, options);
}
}

}

最佳答案

我认为这是错误信息的关键部分:

Cannot allocate memory

iPad 2 只有 512MB 的内存,所以你似乎在用力插入硬件。

关于ios - 在 iPad 上加载大于 256MB 的文件时应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24867759/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com