简体   繁体   English

Appcelerator应用在iOS设备上的Barcode.capture()行上崩溃

[英]Appcelerator app crashing on Barcode.capture() line on iOS device

I need to read QR code in my app. 我需要在我的应用中阅读QR码。 So I am testing on the iOS device. 因此,我正在iOS设备上进行测试。 I added module and I am using this example so far 我添加了模块,到目前为止我正在使用此示例

enter link description here 在此处输入链接说明

App crashing on this line 应用程序在此行崩溃

Barcode.capture({
       animate: true,
       overlay: overlay,
       showCancel: false,
       showRectangle: false,
       keepOpen: true/*,
       acceptedFormats: [
           Barcode.FORMAT_QR_CODE
       ]*/
   });

I tried also without params like this Barcode.capture(); 我也尝试了没有像Barcode.capture();这样的参数Barcode.capture(); but still crashing. 但仍然崩溃。

SDK version is 6.0.1.GA SDK版本为6.0.1.GA

ti.barcode version is 1.9.1 ti.barcode版本为1.9.1

Most likely if there is no log showing the crash then it is related to NSCameraUsageDescription key-value in tiapp.xml. 最可能的是,如果没有日志显示崩溃,则它与tiapp.xml中的NSCameraUsageDescription键值相关。

Add it like this: 像这样添加:

<ios>
    <enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
    <plist>
        <dict>
            <key>UISupportedInterfaceOrientations~iphone</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
            </array>
            <key>UISupportedInterfaceOrientations~ipad</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
                <string>UIInterfaceOrientationPortraitUpsideDown</string>
            </array>
            <key>UIRequiresPersistentWiFi</key>
            <false/>
            <key>UIPrerenderedIcon</key>
            <false/>
            <key>UIStatusBarHidden</key>
            <false/>
            <key>UIStatusBarStyle</key>
            <string>UIStatusBarStyleLightContent</string>

            <key>NSCameraUsageDescription</key>
            <string>Can we use your camera?</string>

            <key>NSPhotoLibraryUsageDescription</key>
            <string>Can we save to your library?</string>
        </dict>
    </plist>
</ios>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM