毕加索没有在 ImageView 中加载图像

Picasso not loading images in ImageView

我想使用 Picasso 将 Url 中的图像加载到简单的 Imageview 中。但不幸的是我遇到了一些问题。我已经包含了下面的日志和相关代码。我已授予互联网许可并使用最新版本的 Picasso。

enter image description here

MainActivity.java

package com.example.picassotest;

import androidx.appcompat.app.AppCompatActivity;

import android.net.Uri;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import org.w3c.dom.Text;

public class MainActivity extends AppCompatActivity {

    ImageView imgView;
    TextView txtView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        imgView = findViewById(R.id.img_view);
        txtView = findViewById(R.id.txtview);
        Picasso.get().setLoggingEnabled(true);
        Picasso.get().load("https://images.unsplash.com/photo-1500100586562-f75ff6540087?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3589&q=80").into(imgView);
    }
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/img_view"
        app:layout_constraintStart_toStartOf="@id/img_view"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@mipmap/ic_launcher_round"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/txtview"
        app:layout_constraintTop_toBottomOf="@id/img_view"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:text="Hey"
        />


</androidx.constraintlayout.widget.ConstraintLayout>

日志

Link: https://pastebin.com/820tP9Jd

在清单中使用它

android:usesCleartextTraffic="true