Error in downloadBitmap - java.io.IOException: Unable to connect to: file://data/data/

alex-1999

Member
May 2, 2024
13
1
3
I define iconRef in Angular Nativescript code as:

<Image #icon />
@ViewChild("icon", { static: false }) iconRef: ElementRef;

and try dynamically changing image as

this.iconRef.nativeElement.src=`file:/${this.getfullIconPath(this.iconPath)}`

file .png is present, I'm sure that file present and path is correct. I can see file on Android studio

JavaError-05012024_232655_1.png

However I receive error

Error in downloadBitmap - java.io.IOException: Unable to connect to: file://data/data/...
Missing Image with resourceID: file://data/data/...

What going wrong?

During last 2 days I try to use a lot of other variants, from adding refresh point

.then((x) => (this.iconRef.nativeElement.src = `${this.iconPath}${"?ts=" + new Date().getTime()}`))

to change folder to ~/assets and, but still failed

Nativescript-05042024_003943-1.png

image present and can be opened by Android Studio

Nativescript-05032024_235859_1.png

however upload it to Image control is impossible. Why? Any ideas?
 
Last edited:
Welcome to Android Central! I moved this to the Software Development forum for more specific traffic.
 
  • Like
Reactions: alex-1999

Members online

Forum statistics

Threads
954,938
Messages
6,963,250
Members
3,163,154
Latest member
AVAJADE275