Android – Glide cannot load image

android, android-glide

I have simple layout with ImageView

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=""    xmlns:tools=""    android:id="@+id/activity_main"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context="com.example.vbusovikov.glidetest.MainActivity">    <ImageView        android:id="@+id/image"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_centerInParent="true"        /></RelativeLayout>

And simple Glide expression to load an image to this ImageView just to test Glide

@Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        ImageView imageView = (ImageView)findViewById(;        Glide.with(this)                .load("")                .error(R.mipmap.ic_launcher)                .into(imageView);    }

However, error icon is shown.
What kind of problem it can be?
I have proxy server on my network, and appropriate for that case.


But even if i try to launch this little app outside of any proxies, it won't work for some reason.

My build.gradle file

apply plugin: ''android {    compileSdkVersion 25    buildToolsVersion "25.0.2"    defaultConfig {        applicationId "com.example.vbusovikov.glidetest"        minSdkVersion 15        targetSdkVersion 25        versionCode 1        versionName "1.0"        testInstrumentationRunner ""    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''        }    }}dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    androidTestCompile('', {        exclude group: '', module: 'support-annotations'    })    compile ''    compile 'com.github.bumptech.glide:glide:3.7.0'    testCompile 'junit:junit:4.12'}

UPD. This simple app can load pictures from internet, but it cannot load pictures from my server. Some pictures of my server are being loaded fine, but others are not. I'm lost with this already

Best Solution

Unfortunatelly, all answers were right, but not working in my conditions. Server settings were not suitable for downloading pictures from it.


After while I figured out, that pictures on my server were broken. You can check if your picture at provided url is valid by opening this url in Mozilla Firefox.Last few kilobytes in pictures may be deleted, but browsers like Google Chrome ignores that and shows image normally. However, Firefox is more sensitive, so it helps to localize the problem.


After another while i figured out that not only broken pictures can cause the problem. Try add android:usesCleartextTraffic="true" in Manifest in application. It will solve some issues with picture loading