title: Unable to load image with Picasso in Android Studio 3.4.2
body: <p>I'm trying the example in the docs to load an image</p>
  
  <pre><code>val img = findViewById&lt;ImageView&gt;(R.id.imageView)
  Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(img)
  </code></pre>
  
  <p>It's not loading the image.</p>
  
  <p>Here's my <code>activity_main.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity"&gt;
  
      &lt;Button
              android:text="Button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/button"
              app:layout_constraintStart_toStartOf="@+id/editText" android:layout_marginTop="62dp"
              android:layout_marginLeft="59dp" android:layout_marginStart="59dp"
              app:layout_constraintTop_toBottomOf="@+id/editText"/&gt;
      &lt;EditText
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:inputType="textPersonName"
              android:text="Name"
              android:ems="10"
              android:id="@+id/editText"
              app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="89dp"
              app:layout_constraintBottom_toBottomOf="parent" android:layout_marginStart="89dp"
              android:layout_marginBottom="217dp" app:layout_constraintTop_toBottomOf="@+id/imageView"/&gt;
      &lt;ImageView
              android:src="@drawable/ic_launcher_background"
              android:layout_width="224dp"
              android:layout_height="0dp"
              android:id="@+id/imageView" tools:visibility="visible"
              android:layout_marginTop="208dp" android:layout_marginBottom="50dp"
              app:layout_constraintBottom_toTopOf="@+id/editText" app:layout_constraintTop_toTopOf="parent"
              app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="80dp"
              android:layout_marginStart="80dp"/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>I'm new to android dev -- any tips on how to debug/solve this issue would be super helpful!</p>
  
  <p>Edit:  I I have set internet permissions: </p>
  
  <p><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;</code></p>
  
  <p>and the problem still persists :(</p>
  
  <p>I even added a listener:</p>
  
  <pre><code>       val picasso = Picasso.Builder(this)
              .listener { _, _, e -&gt;
                  run {
                      println("fuck")
                      e.printStackTrace()
                  }
              }
              .build()
  
  </code></pre>
  
  <p>And no stacktrace got printed out, and yet the image still doesn't load. Sigh.</p>
  
  <p>My <code>build.gradle</code></p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext.kotlin_version = '1.3.31'
      repositories {
          google()
          jcenter()
  
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.4.2'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
  
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <h2>Solution</h2>
  
  <p>The problem was, I was trying to load the image from within an <code>executor</code> function. There's a check in picasso source that allows for image loads to happen only within the <code>main</code> function </p>
  
  <pre><code>
    public void into(ImageView target, Callback callback) {
      long started = System.nanoTime();
      checkMain();
  </code></pre>
  
  <p>(I'm curious why the app never threw a stacktrace though...I'm guessing it was probably suppressed by a dependency or something?)</p>