我的离子型应用程序使用:
"@ionic-native/barcode-scanner": "^5.19.1",
"phonegap-plugin-barcodescanner": "^8.1.0",当我打电话给barcode.scan funcion时,安卓应用程序就会崩溃。我正在做任何事情,就像在一个非常基本的例子:https://ionicframework.com/docs/native/barcode-scanner
注意:我现在正在android7版本上测试这个。这款手机不是很新,但也不是很旧。它在接受相机权限后立即崩溃。
在catch块或任何东西中没有错误消息,应用程序只是崩溃。有没有人经历过这种情况,或者能帮我调查更多的日志?
发布于 2020-02-18 20:36:31
我发现了这个问题,基本原因是AndroidManifest.xml文件中缺少了AndroidManifest.xml:
<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中被描述过,但是它需要清单文件的活动。
https://stackoverflow.com/questions/60288197
复制相似问题