小编Piv*_*man的帖子

FileProvider - IllegalArgumentException:找不到配置的root

我正试图用相机拍照,但我收到以下错误:

FATAL EXCEPTION: main
Process: com.example.marek.myapplication, PID: 6747
java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/com.example.marek.myapplication/files/Pictures/JPEG_20170228_175633_470124220.jpg
    at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:711)
    at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400)
    at com.example.marek.myapplication.MainActivity.dispatchTakePictureIntent(MainActivity.java:56)
    at com.example.marek.myapplication.MainActivity.access$100(MainActivity.java:22)
    at com.example.marek.myapplication.MainActivity$1.onClick(MainActivity.java:35)
Run Code Online (Sandbox Code Playgroud)

AndroidManifest.xml中:

<provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.example.marek.myapplication.fileprovider"
        android:enabled="true"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
</provider>
Run Code Online (Sandbox Code Playgroud)

Java的:

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 …
Run Code Online (Sandbox Code Playgroud)

android android-fileprovider

173
推荐指数
14
解决办法
10万
查看次数

如何读取lucene 5.5.5索引?

什么版本的 Luke 能够读取 5.5.5 lucene 的索引?我试过 Luke 4.10, 5.2, 5.5, 7.2 但总是得到这个:

Invalid directory at the location, check console for more information. Last exception:
org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path=""))): this index is too old (version: 5.5.5). This version of Lucene only supports indexes created with release 6.0 and later.
Run Code Online (Sandbox Code Playgroud)

java lucene indexing luke

5
推荐指数
1
解决办法
745
查看次数

标签 统计

android ×1

android-fileprovider ×1

indexing ×1

java ×1

lucene ×1

luke ×1