我在开发客户端上使用最新的expo-47,我负责创建自定义的开发客户端,其中包括我在给定代码上使用的库。
因此,我将解释我的情况(我的目标是android):
-
在当地的世博会资产中,我有30张图片
我想允许用户
共有
使用的图像
expo-sharing
但我犯了错误[见文章末尾]
以下是我尝试过的许多代码的示例,但都不起作用:
import * as Sharing from 'expo-sharing'
async function shareImage(imageURI) {
try {
await Sharing.shareAsync(require('../../../assets/images/motivational/36.jpg'))
} catch (error) {
console.log(error)
}
}
错误如下:
[Error: Argument of an incompatible class: class java.lang.Double cannot be passed as an argument to parameter expecting class java.lang.String.]
这是什么意思?
我当然已经验证了图像存在于给定的路径上