我一直试图从Firebase Storage下载PDF文件,并将其存储在 本地存储 ,而不是外部。
发生异常:
com.google.firebase.storage.StorageException:发生未知错误,请检查HTTP结果代码和服务器响应的内部异常。
下载和存储文件的代码:
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1008)
at com.google.firebase.storage.FileDownloadTask.processResponse(com.google.firebase:firebase-storage@@19.0.1:136)
at com.google.firebase.storage.FileDownloadTask.run(com.google.firebase:firebase-storage@@19.0.1:227)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@19.0.1:1072)
at com.google.firebase.storage.StorageTask$$Lambda$12.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2019-09-18 20:38:01.109 32195-32312/com.example.android.notes E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 200
2019-09-18 20:38:01.156 32195-32312/com.example.android.notes E/StorageException: No such file or directory
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1008)
at com.google.firebase.storage.FileDownloadTask.processResponse(com.google.firebase:firebase-storage@@19.0.1:136)
at com.google.firebase.storage.FileDownloadTask.run(com.google.firebase:firebase-storage@@19.0.1:227)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@19.0.1:1072)
at com.google.firebase.storage.StorageTask$$Lambda$12.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2019-09-18 20:38:01.163 32195-32312/com.example.android.notes E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 200
2019-09-18 20:38:01.242 32195-32312/com.example.android.notes E/StorageException: No such file or directory
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1008)
at com.google.firebase.storage.FileDownloadTask.processResponse(com.google.firebase:firebase-storage@@19.0.1:136)
at com.google.firebase.storage.FileDownloadTask.run(com.google.firebase:firebase-storage@@19.0.1:227)
at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@19.0.1:1072)
at com.google.firebase.storage.StorageTask$$Lambda$12.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2019-09-18 20:38:40.889 32195-32195/com.example.android.notes E/Download Failed:: com.google.firebase.storage.StorageException: An unknown error occurred, please check the HTTP result code and inner exception for server response.
Logcat例外:
File rootPath = new File(Environment.getDataDirectory(), "notesApp");
编辑:
已替换File rootPath = new File(getBaseContext().getFilesDir(), "notesApp");
与
error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
现在显示的唯一错误是:
$currentCategory = single_cat_title("", false);
$paged = (get_query_var( 'paged' )) ? get_query_var( 'paged' ) : 1;
$args = array(
'post_type' => 'page',
'post_status' => 'publish',
'meta_key' => '_wp_page_template',
'meta_value' => 'post.php',
'category_name' => $currentCategory,
'posts_per_page' => 12,
'paged' => $paged,
);
$arr_posts = new WP_Query( $args );