Jose Q
Jose Q

Reputation: 450

Image in Firebase Storage doesn't load with Picasso

I'm working with Firebase Storage, Firebase Database and Picasso and I have a problem.

My app uploads an image to Firebase Storage and then saves the image download url (using taskSnapshot.getDownloadUrl().toString()) in Firebase Database.

The url looks like this:

"https://firebasestorage.googleapis.com/v0/b/<my-storage-name>.appspot.com/o/Photos%2F40?alt=media&token=<my-token>"

I'm using Picasso to receive this link (var link):

Picasso.with(MainActivity.this).load(link).into(imageView);

I have verified that the script works fine with other image urls but not with Firebase Storage urls. Please help

UPDATE

I added:

Picasso.with(MainActivity.this).setLoggingEnabled(true);

And this is the Android Monitor Log, first image is my Facebook profile image and works:

12-19 23:11:20.279 8710-8710/com.example.john.finality D/Picasso: Main        created      [R8] Request{https://scontent.xx.fbcdn.net/v/t1.0-1/p100x100/1465305_691312327560317_1869531162_n.jpg?oh=e86c935ff4945a4573cf75874a095150&oe=58D2344F}
12-19 23:11:20.281 8710-8710/com.example.john.finality D/Picasso: Main        completed    [R8] from MEMORY
12-19 23:11:20.281 8710-8710/com.example.john.finality D/Picasso: Main        created      [R9] Request{https://firebasestorage.googleapis.com/v0/b/<my-storage-name>.appspot.com/o/Photos%2F45?alt=media&token=affebbe7-5a8a-4fc1-bf44-bbb2f971cc01 resize(350,350)}
12-19 23:11:20.282 8710-8952/com.example.john.finality D/Picasso: Dispatcher  enqueued     [R9]+0ms 
12-19 23:11:20.282 8710-8974/com.example.john.finality D/Picasso: Hunter      executing    [R9]+0ms 
12-19 23:11:22.421 8710-8952/com.example.john.finality D/Picasso: Dispatcher  retrying     [R9]+2140ms 
12-19 23:11:22.422 8710-8973/com.example.john.finality D/Picasso: Hunter      executing    [R9]+2140ms 
12-19 23:11:23.525 8710-8952/com.example.john.finality D/Picasso: Dispatcher  retrying     [R9]+3243ms 
12-19 23:11:23.526 8710-8976/com.example.john.finality D/Picasso: Hunter      executing    [R9]+3244ms 
12-19 23:11:23.538 8710-8952/com.example.john.finality D/Picasso: Dispatcher  batched      [R9]+3257ms for error
12-19 23:11:23.771 8710-8952/com.example.john.finality D/Picasso: Dispatcher  delivered    [R9]+3489ms 
12-19 23:11:23.771 8710-8710/com.example.john.finality D/Picasso: Main        errored      [R9]+3489ms 

Upvotes: 2

Views: 3215

Answers (1)

Jose Q
Jose Q

Reputation: 450

I changed from Picasso to Glide and it works.

Gradle:

compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.android.support:support-v4:24.2.1'

Activity:

Glide.with(MainActivity.this).load(link).dontAnimate().into(imageView);

UPDATE

Updating Picasso to 2.5.2 also solves the problem.

Upvotes: 1

Related Questions