gpt4 book ai didi

java - 当我打开相机时应用程序崩溃

转载 作者:行者123 更新时间:2023-12-02 03:37:16 24 4
gpt4 key购买 nike

当我按下按钮打开相机时,我的应用程序崩溃了。

日志猫:

05-18 19:33:41.644 386-2041/? E/CameraService: Permission Denial: can't use the camera pid=18519, uid=10159
05-18 19:33:41.648 18519-18519/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: involved.pose9, PID: 18519
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.<init>(Camera.java:511)
at android.hardware.Camera.open(Camera.java:368)
at involved.pose9.CameraActivity$1.onClick(CameraActivity.java:48)
at android.view.View.performClick(View.java:5201)
at android.view.View$PerformClick.run(View.java:21163)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

最佳答案

将其添加到您的 list 中:

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

关于java - 当我打开相机时应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37305446/

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