gpt4 book ai didi

android - CameraX 配置不正确。最可能的原因是您没有在构建中包含默认实现,例如“camera-camera2”

转载 作者:行者123 更新时间:2023-12-04 23:37:17 27 4
gpt4 key购买 nike

androidx.camera:camera-view:1.0.0-alpha32 更新后至androidx.camera:camera-view:1.1.0-beta01使用 CameraX 时收到下一个错误

camerax_version = "1.0.2"

// CameraX
implementation "androidx.camera:camera-core:$camerax_version"
implementation "androidx.camera:camera-camera2:$camerax_version"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:1.1.0-beta01"
错误
java.lang.IllegalStateException: CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2'.
at androidx.camera.core.CameraX.<init>(CameraX.java:109)
at androidx.camera.lifecycle.ProcessCameraProvider.getOrCreateCameraXInstance(ProcessCameraProvider.java:181)
at androidx.camera.lifecycle.ProcessCameraProvider.getInstance(ProcessCameraProvider.java:167)

最佳答案

它失败了,因为您对各种 androidx.camera.* 库有不同的版本。
如果你检查这个:
https://developer.android.com/jetpack/androidx/releases/camera
它有以下描述:

From 1.1.0-beta01, all CameraX libraries will align the same versionnumber. This will help developers track versions much easier andreduce the complexity of large version compatibility matrix.


因此,您需要对所有 camerax 库使用相同的版本。

关于android - CameraX 配置不正确。最可能的原因是您没有在构建中包含默认实现,例如“camera-camera2”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71158336/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com