【问题标题】:Titanium iOS App crashes after taking 25+ images with the cameraTitanium iOS 应用程序在使用相机拍摄 25 多张图像后崩溃
【发布时间】:2019-05-16 11:23:02
【问题描述】:

我正在开发使用相机拍照的钛应用程序。拍摄大约 15 张以上的照片后,该应用程序将崩溃。我发现在 Appcelerator Titanium 端 https://jira.appcelerator.org/browse/TIMOB-24389https://jira.appcelerator.org/browse/AC-6225 上报告了同样的问题,但我在那里看不到解决方案。我尝试了那里的建议,但这并不能解决问题。

这里还有一些简单的应用程序。 脚步: 1.点击“添加照片”按钮 2.拍照 3.点击“使用照片” 4.重复步骤 15 次以上。

App在拍照过程中崩溃。

用不同的设备和不同的Titanium SDK测试,每次都可以重现。

var win = Ti.UI.createWindow({});
var view = Ti.UI.createView({});

var button = Ti.UI.createButton({
    color : '#000000',
    title : "Add photo",
    height : 'auto',
    width : 'auto'
});
view.add(button);

button.addEventListener('click', function(e) {
    showCamera();
});

function showCamera() {
    Titanium.Media.showCamera({
        showControls : true, 
        mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
        autorotate : true,
        success : function(event) {
        },
        error : function(error) {
        },
        cancel : function() {
        }
    });
}

win.add(view);
win.open();

有谁知道一些解决方法如何避免这种崩溃? 谢谢。

【问题讨论】:

  • 你用的是哪个 Ti SDK?
  • 我可以在从 6.3.0 到 8.0.0 的每个 Ti SDK 上重现它。

标签: appcelerator appcelerator-titanium


【解决方案1】:

我曾经有过同样的问题很长时间了。

对于 iOS,您需要在 tiapp.xml 文件中将 <use-jscore-framework> 标志设置为 true。 Titanium SDK 7.0.0 及更高版本默认启用此标志。

https://jira.appcelerator.org/browse/TIMOB-24206

【讨论】:

  • 感谢您的重播,我已将该标志设置为 true,并且使用 Titanium SDK 8.0.0 它可以正常工作。但是,如果我使用相机叠加,它仍然会崩溃,并且在我的应用中我正在使用叠加。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多