Issue 1:
Glide Version: 3.0.1

Integration libraries:

Device/Android Version: Android 7.1.1

Issue details / Repro steps / Use case background:

Glide load line / GlideModule (if any) / list Adapter code (if any):

Glide.with...

Layout XML:

<FrameLayout xmlns:android="...

Stack trace / LogCat:

paste stack trace and/or log here

I tested version >= 4.4.0, when I click icon turn to MainActivity, has a crash.

version <= 4.3.1, no crash.

MainActivity do nothing, only onCreate() { super.onCreate(); setContentView(R.layout.activity_main); }

this is the crash log:

03-02 15:12:33.452 1716-1897/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243

03-02 15:12:33.458 1716-1897/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243

03-02 15:12:33.459 612-2691/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only

03-02 15:12:33.464 1716-3080/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243

03-02 15:12:33.516 1716-3080/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.home/com.miui.home.launcher.Launcher/10000

03-02 15:12:33.817 612-2691/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]

03-02 15:12:34.721 2802-2802/? E/CardEmulation: AID 2PAY.SYS.DDF01 is not a valid AID.

03-02 15:12:34.721 2802-2802/? E/ApduServiceInfo: Ignoring invalid or duplicate aid: 2PAY.SYS.DDF01

03-02 15:12:34.732 2802-2802/? E/RegisteredServicesCache: Next Tag=services

03-02 15:12:34.733 2802-2802/? E/RegisteredServicesCache: 1invalidateCache:WriteServiceStateToFile

03-02 15:12:34.733 2802-2802/? E/RegisteredServicesCache: Writing service state Data Always

03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: component namecom.eg.android.AlipayGphone/com.alipay.android.phone.offlinepay.nfc.CardService

03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: uid name10070

03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: service State:2

03-02 15:12:34.889 2951-3259/? E/Launcher.AllAppsList: Can't load postion for packageName: innocent.test activityName: innocent.test.MainActivity

03-02 15:12:35.059 612-2691/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only

03-02 15:12:35.060 1716-11202/? E/ActivityTrigger: activityStartTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1

03-02 15:12:35.063 1716-11202/? E/ActivityTrigger: activityResumeTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1

03-02 15:12:35.065 1716-3173/? E/ActivityTrigger: activityResumeTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1

03-02 15:12:35.104 6811-6811/? E/art: No implementation found for int cn.jpush.android.service.PushProtocol.GetSdkVersion() (tried Java_cn_jpush_android_service_PushProtocol_GetSdkVersion and Java_cn_jpush_android_service_PushProtocol_GetSdkVersion__)

03-02 15:12:35.104 6811-6811/? E/JPush: [JPushGlobal] Get sdk version fail![获取sdk版本失败!]

03-02 15:12:35.105 6811-6811/? E/JPush: [JPushGlobal] JPush .so file do not match JPush .jar file in the project, Failed to init JPush

03-02 15:12:35.124 2847-3066/? E/WtProcessController: Error pid or pid not exist

03-02 15:12:35.346 6112-6112/? E/AndroidRuntime: FATAL EXCEPTION: main

Process: innocent.test, PID: 6112

java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics/Typeface; in class Landroid/support/v4/content/res/ResourcesCompat; or its super classes (declaration of 'android.support.v4.content.res.ResourcesCompat' appears in /data/app/innocent.test-1/split_lib_dependencies_apk.apk)

at android.support.v7.widget.TintTypedArray.getFont(TintTypedArray.java:119)

at android.support.v7.widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:208)

at android.support.v7.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:110)

at android.support.v7.widget.AppCompatTextHelperV17.loadFromAttributes(AppCompatTextHelperV17.java:38)

at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:81)

at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:71)

at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:67)

at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:753)

at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261)

at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243)

at android.support.v7.widget.ActionBarOverlayLayout.setWindowTitle(ActionBarOverlayLayout.java:621)

at android.support.v7.app.AppCompatDelegateImplV9.onTitleChanged(AppCompatDelegateImplV9.java:631)

at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)

at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)

at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)

at innocent.test.MainActivity.onCreate(MainActivity.java:11)

at android.app.Activity.performCreate(Activity.java:6861)

at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2801)

at android.app.ActivityThread.-wrap12(ActivityThread.java)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:163)

at android.app.ActivityThread.main(ActivityThread.java:6368)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791)

03-02 15:12:35.365 2847-3066/? E/WtProcessController: Error pid or pid not exist

03-02 15:12:35.366 1716-11135/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.home/com.miui.home.launcher.Launcher/10000

03-02 15:12:35.478 14403-14495/? E/Market-LocalAppManager: [InvalidPackageList] JSON : list is null

03-02 15:12:35.680 14403-21265/? E/Market-ConnectionRSA: get key exception : com.android.org.bouncycastle.util.encoders.DecoderException: unable to decode base64 string: invalid characters encountered in base64 data

03-02 15:12:37.071 612-2691/? E/ANDR-PERF-OPTSHANDLER: perf_lock_rel: updated /sys/class/mmc_host/mmc0/clk_scaling/enable with 1

return value 2

03-02 15:12:37.073 612-2691/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]

03-02 15:12:37.719 941-1644/? E/Parcel: Reading a NULL string not supported here.

this is my build.gradle of app:

apply plugin: 'com.android.application'

android {

compileSdkVersion 26

defaultConfig {

applicationId "innocent.test"

minSdkVersion 14

targetSdkVersion 26

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:26.1.0'

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

testImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test🏃0.5'

androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

// Glide图片加载库
compile 'com.github.bumptech.glide:glide:4.3.1'
// annotationProcessor 'com.github.bumptech.glide:compiler:3.7.0'

// Picasso图片加载库
// implementation 'com.squareup.picasso:picasso:2.5.2'

}

Issue 2:
Glide Version: 4.0.0 SNAPSHOT from 10/22/2016

How should I implement

requestManager.load(avatarUrl)
.fitCenter()
.placeholder(R.drawable.profile_photo_stub)
.into(viewHolder.avatarImg);

using 4.x API?

Looks like it should be something like

requestManager.load(avatarUrl)
.apply(RequestOptions.fitCenterTransform(getContext()))
.apply(RequestOptions.placeholderOf(R.drawable.profile_photo_stub))
.into(viewHolder.avatarImg);

but it seems too heavy and complex for me.

Why fitCenterTransform requires context and doesn't get it from the requestManager?