我想从firebase存储下载图像文件。但是,当我点击下载按钮时,它会给我一个错误,即“{3}}"
无法下载文件这是我的下载按钮代码
downloadbtn=(ImageButton)findViewById(R.id.downloadbutton);
downloadbtn.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Log.v(TAG, " download button click=" + path);
//path contain download url link
// "Myimages/images/" + mFileUri.getLastPathSegment();
Intent intent = new Intent(MainActivity.this, MyDownloadService.class);
intent.setAction(MyDownloadService.ACTION_DOWNLOAD);
intent.putExtra(MyDownloadService.EXTRA_DOWNLOAD_PATH, path);
startService(intent);
//Show loading spinner
showProgressDialog();
}
});
我的logcat在
之下08-06 20:33:59.640 20806-20806/com.example.firebase.storage V/MyActivity: on click method execute =https://firebasestorage.googleapis.com/v0/b/android-start-654f1.appspot.com/o/Myimages%2Fimages%2F10469?alt=media&token=47b6b8dc-f0aa-4413-a73f-06c1aab36a07
08-06 20:34:02.513 20806-20806/com.example.firebase.storage V/MainActivity: download button click=https://firebasestorage.googleapis.com/v0/b/android-start-654f1.appspot.com/o/Myimages%2Fimages%2F10469?alt=media&token=47b6b8dc-f0aa-4413-a73f-06c1aab36a07
08-06 20:34:02.984 20806-20806/com.example.firebase.storage D/Storage#DownloadService: onStartCommand:Intent { act=action_download cmp=com.example.firebase.storage/.MyDownloadService (has extras) }:1
08-06 20:34:02.984 20806-20806/com.example.firebase.storage D/Storage#DownloadService: action_download:https://firebasestorage.googleapis.com/v0/b/android-start-654f1.appspot.com/o/Myimages%2Fimages%2F10469?alt=media&token=47b6b8dc-f0aa-4413-a73f-06c1aab36a07
08-06 20:34:02.984 20806-20806/com.example.firebase.storage D/Storage#DownloadService: changeNumberOfTasks:0:1
08-06 20:34:03.034 20806-22421/com.example.firebase.storage I/DynamiteModule: Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:1
08-06 20:34:03.044 20806-22421/com.example.firebase.storage I/DynamiteModule: Selected remote version of com.google.android.gms.firebasestorage, version >= 1
08-06 20:34:06.027 20806-22421/com.example.firebase.storage E/StorageException: StorageException has occurred.
Object does not exist at location.
Code: -13010 HttpResult: 404
08-06 20:34:06.067 20806-20806/com.example.firebase.storage W/Storage#DownloadService: download:FAILURE
com.google.firebase.storage.StorageException: Object does not exist at location.
at com.google.firebase.storage.StreamDownloadTask.zzcyk(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.zzcxy(Unknown Source)
at com.google.firebase.storage.StorageTask.zzcyg(Unknown Source)
at com.google.firebase.storage.zze.zzcym(Unknown Source)
at com.google.firebase.storage.StorageTask.zzi(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask$5.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
08-06 20:34:06.067 20806-20806/com.example.firebase.storage D/Storage#DownloadService: changeNumberOfTasks:1:-1
08-06 20:34:06.067 20806-20806/com.example.firebase.storage D/Storage#DownloadService: stopping
08-06 20:34:06.087 20806-20806/com.example.firebase.storage D/MainActivity: downloadReceiver:onReceive:Intent { act=action_error (has extras) }