Firebase Storage异常:The storage Uri cannot contain a path element
Firebase Storage 抛出异常:The storage Uri cannot contain a path element
之前一直正常运行的代码,昨天突然无征兆抛出如下异常:
The storage Uri cannot contain a path element.
出问题的代码行:
val storageReference = FirebaseStorage.getInstance().getReference(senderRoom.plus("/Media/Picture/".plus(imageName)))
其中imageName的值为 "1695929588446"
我已经尝试了以下几种写法,但都没能解决问题:
- 仅传入文件名(移除路径),仍报相同异常:
val storageReference = FirebaseStorage.getInstance().getReference(imageName)
- 改用
child()方法拼接路径,依旧无效:
val storageReference = FirebaseStorage.getInstance().getReference().child(senderRoom.plus("/Media/Picture/".plus(imageName)))
当前使用的Firebase Storage依赖版本:
implementation 'com.google.firebase:firebase-storage-ktx:20.0.1'
内容的提问来源于stack exchange,提问作者Jaffar
相关产品推荐
相关产品推荐

