Ionic和phonegap条形码扫描器应用在Android上崩溃

问题描述 投票:0回答:1

我的离子应用程序使用:

"@ionic-native/barcode-scanner": "^5.19.1",
"phonegap-plugin-barcodescanner": "^8.1.0",

[当我调用条形码。扫描功能时,Android应用立即崩溃。我正在做非常基本的示例中的所有操作:https://ionicframework.com/docs/native/barcode-scanner

注意:目前,我正在android7版本上对此进行测试。电话不是很新,但也不是很旧。接受相机权限。

后,它立即崩溃

[catch块中没有错误消息或其他任何内容,应用只是崩溃。有没有人遇到过这种情况或可以帮助我调查更多日志?

ionic-framework cordova-plugins ionic4 phonegap-plugins
1个回答
0
投票

我已经找到了问题,基本上是从AndroidManifest.xml文件中丢失了com.google.zxing.client.android.SCAN:

<activity android:configChanges="orientation|keyboardHidden" android:name="com.google.zxing.client.android.CaptureActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.google.zxing.client.android.SCAN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

不知道为什么插件安装未添加任何内容,也未在github中进行描述,但是清单文件需要活动。

© www.soinside.com 2019 - 2024. All rights reserved.