无法使用钛金属相机

发布于 2024-12-17 10:16:39 字数 350 浏览 7 评论 0原文

在我的钛应用程序中,我需要从相机拍照,在调用相机操作时出现以下错误我

Permission failure: android.permission.CAMERA from uid=10037 pid=407
E/CameraService(   34): Permission Denial: can't use the camera pid=407, uid=10037

通过以下代码调用相机

Titanium.Media.showCamera({
 .....
 .....
});

我必须在哪里添加使用相机的权限?任何人都可以帮我解决这个问题。

In my Titanium application I need to take pictures from camera, while invoking the camera action I am getting following error

Permission failure: android.permission.CAMERA from uid=10037 pid=407
E/CameraService(   34): Permission Denial: can't use the camera pid=407, uid=10037

I am invoking the camera by following code

Titanium.Media.showCamera({
 .....
 .....
});

Where I have to add permission to use Camera? Anyone help me to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你げ笑在眉眼 2024-12-24 10:16:39

对于 Android 应用程序,您需要将以下行添加到 manifest.xml 标记之外):

<uses-permission android:name="android.permission.CAMERA" />

在使用 Titanium 的情况下,您通过将以下行添加到 标记下的 tiapp.xml 中,可以达到相同的效果,如下所示:

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
        <uses-permission android:name="android.permission.CAMERA" />
    </manifest>
</android>

For Android applications, you need to add the following line to manifest.xml (outside of the <application> tag):

<uses-permission android:name="android.permission.CAMERA" />

In in which you're using Titanium, you can achieve the same effect by adding the line to tiapp.xml under the <manifest> tag, like this:

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
        <uses-permission android:name="android.permission.CAMERA" />
    </manifest>
</android>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文