繁体   English   中英

滑翔不加载在线图像

[英]Glide not loading online Images

我在将在线图像加载到 Glide 时遇到问题:我尝试了这些代码:

我的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'
        }

注意:我无法更改我的 API 级别

在不改变 gradle 的 Api 级别的情况下如何解决这个问题?

这是我调用的 Glide 代码

主要活动


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);

有什么解决办法吗?

你可以试试最新版本

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

然后

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

供参考

  1. 您正在使用OLD compile 移至implementation
  2. 移至AndroidX
  3. compileSdkVersion应该是 29。

暂无
暂无

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

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