Couldn't find meta-data for provider with authority

后端 未结 10 1240
粉色の甜心
粉色の甜心 2020-12-05 10:12

I have integrated Snapchat\'s Creative Kit in my Android app. After processing, I receive an image from the server in the form of Byte Array which I am saving to the disk an

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 10:39

        
            
        
    

    This is my provider declaration, the value of ${applicationId} is "com.limxtop.research", make sure that the name of authorities is the same with that of the codes below.

                // Create the file where the photo should save.
                File file = null;
                try {
                    file = createImageFile();
                } catch (IOException e) {
                    break;
                }
                // The second parameter is the name of authorities.
                Uri uri = FileProvider.getUriForFile(this,
                        "com.limxtop.research.fileprovider", file);
                intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
                intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                        | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
                startActivityForResult(intent, fullSizeRequestCode);
    

    So, maybe your codes post here is not complete, there you should pass "my.package.name.fileprovider" as parameter some where.

提交回复
热议问题