Android-如果我启动摄像头-分配检测到的数据竞赛

Android-如果我启动摄像头-分配检测到的数据竞赛,android,camera,signals,sigabrt,Android,Camera,Signals,Sigabrt,当我使用此代码启动相机时: Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // Ensure that there's a camera activity to handle the intent if (takePictureIntent.resolveActivity(getPackageManager()) != null) { // C

当我使用此代码启动相机时:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        // Ensure that there's a camera activity to handle the intent
        if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
            // Create the File where the photo should go
            File photoFile = null;
            try {
                photoFile = createImageFile();
            } catch (IOException ex) {
                // Error occurred while creating the File

            }
            // Continue only if the File was successfully created
            if (photoFile != null) {
                Uri photoURI = FileProvider.getUriForFile(this,
                        BuildConfig.APPLICATION_ID + ".fileprovider",
                        photoFile);
                takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
                startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
            }
        }
我得到这个错误:

A/sp: sp<> assignment detected data race
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 23833 (RenderThread), pid 23705 (name.name)
A/sp:sp分配检测到数据争用
A/libc:tid 23833(渲染读取)中的致命信号6(SIGABRT),代码-6(SI_TKILL),pid 23705(name.name)

有人知道错误消息的含义以及我如何解决问题吗?

有什么证据表明这是来自你的应用程序?请记住,
ACTION\u IMAGE\u CAPTURE
可能会启动数百个摄像头应用程序中的任意一个,具体取决于用户的设备和安装内容。其中一些会有bug,你对此无能为力。哦,好吧。我如何更改代码以使该方法不会调用其他应用程序?你说的“没有其他应用程序”是什么意思?相机应用的选择取决于用户,而不是你。我认为你不理解我的问题。上面的代码在我的应用程序中通过一个按钮执行。然后摄像头打开,出现错误消息。将
标志\u授予\u写入\u URI\u权限添加到您的
意图中
,然后查看是否有帮助。如果不是,我猜这是你正在尝试的特定相机应用程序中的一个bug。