简体   繁体   English

滑翔不加载在线图像

[英]Glide not loading online Images

I am facing problem about loading a online image into Glide: I have tried those code:我在将在线图像加载到 Glide 时遇到问题:我尝试了这些代码:

My build.gradle我的build.gradle


apply plugin: 'com.android.application'

    android {
        compileSdkVersion 27
        defaultConfig {
        applicationId "com.devX.meta"
        minSdkVersion 14
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        }
    }

    dependencies {
        compile 'com.android.support:cardview-v7:27.0.0'
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:27.0.0'
        // implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        compile 'com.github.bumptech.glide:glide:3.8.0'
        }

NB: I can't Change my API Level注意:我无法更改我的 API 级别

Without Changing Api Level of gradle how to solve this?在不改变 gradle 的 Api 级别的情况下如何解决这个问题?

This is the Glide Code Which I am calling From这是我调用的 Glide 代码

MainActivity主要活动


Glide.with(this).load("https://animevaya.000webhostapp.com/wp-content/uploads/2020/05/ic_launcher-web.png").placeholder(R.drawable.window).error(R.drawable.bg_white_text_red).into(ImgX);

Have any Solution?有什么解决办法吗?

You can try with latest version你可以试试最新版本

   implementation 'com.github.bumptech.glide:glide:4.11.0'
   annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' 

Then然后

 RequestManager requestManager = Glide.with(this);
 RequestBuilder requestBuilder = requestManager.load("your_url");
 requestBuilder.into(imageViewOBJ);

FYI供参考

  1. You are using OLD compile .您正在使用OLD compile Move to implementation .移至implementation
  2. Move to AndroidX .移至AndroidX
  3. compileSdkVersion should be 29. compileSdkVersion应该是 29。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM