8

我正在尝试使用Firebase ML套件扫描 QR 码,但我无法在 android Pie(诺基亚 6.1 Plus)上启动相机。但是,相同的代码可以正常工作Android Oreo Redmi 6 A

这是我的毕业生:

implementation "com.google.firebase:firebase-ml-vision:21.0.0"
implementation "androidx.camera:camera-core:1.0.0-alpha05"
implementation "androidx.camera:camera-camera2:1.0.0-alpha05"

我已在 Manifest 中授予相机所需的所有权限和功能

这是我使用 Camera X 代码的方式:

      val previewConfig = PreviewConfig.Builder()
                .setLensFacing(CameraX.LensFacing.BACK)
                .build()

      val preview = Preview(previewConfig)


 preview.setOnPreviewOutputUpdateListener { previewOutput ->
                    textureView.surfaceTexture = previewOutput.surfaceTexture
                }


val imageAnalysisConfig = ImageAnalysisConfig.Builder()
                    .build()
                val imageAnalysis = ImageAnalysis(imageAnalysisConfig)

日志猫:

   E/libc: Access denied finding property "vendor.camera.aux.packagelist"
    W/com.zup.cash: type=1400 audit(0.0:17168): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=18547 scontext=u:r:untrusted_app:s0:c130,c258,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/GLConsumer: [SurfaceTexture-0-7457-1] updateAndRelease: GLConsumer is not attached to an OpenGL ES context
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=QRScanner, firebase_previous_id(_pi)=-1919220789441294810, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-1919220789441294811}]
4

0 回答 0