ERROR Error: Uncaught (in promise): Asset '/storage/emulated/0/DCIM/Restored/IMG_20200115_103131.jpg' cannot be found
ERROR Error: Uncaught (in promise): Asset '/storage/emulated/0/DCIM/Restored/IMG_20200115_103131.jpg' cannot be found
正在处理 nativescript 应用程序,需要访问图像并将其转换为 base64。
.then(function(selection) {
selection.forEach(function (selected) {
imageSourceModule
.fromAsset(selected)
.then((imageSource) => {
var imageBase64 = imageSource.toBase64String("jpg",60);
console.log(imageBase64);
我遇到了与 fromAsset
相同的问题,我通过这样做解决了它。
<application
...
android:requestLegacyExternalStorage="true"
...
</application>
正在处理 nativescript 应用程序,需要访问图像并将其转换为 base64。
.then(function(selection) {
selection.forEach(function (selected) {
imageSourceModule
.fromAsset(selected)
.then((imageSource) => {
var imageBase64 = imageSource.toBase64String("jpg",60);
console.log(imageBase64);
我遇到了与 fromAsset
相同的问题,我通过这样做解决了它。
<application
...
android:requestLegacyExternalStorage="true"
...
</application>