<p dir="auto"><strong>Glide Version</strong>: 3.0.1</p>

<p dir="auto"><strong>Integration libraries</strong>:</p>

<p dir="auto"><strong>Device/Android Version</strong>: Android 7.1.1</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:</p>

<p dir="auto"><strong>Glide load line / <code class="notranslate">GlideModule</code> (if any) / list Adapter code (if any)</strong>:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Glide.with..."><pre class="notranslate"><span class="pl-smi">Glide</span>.<span class="pl-smi">with</span>...</pre></div>

<p dir="auto"><strong>Layout XML</strong>:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;FrameLayout xmlns:android=&quot;..."><pre class="notranslate">&lt;<span class="pl-ent">FrameLayout</span> <span class="pl-e">xmlns</span><span class="pl-e">:</span><span class="pl-e">android</span>=<span class="pl-s"><span class="pl-pds">"</span>...</span></pre></div>

<p dir="auto"><strong>Stack trace / LogCat</strong>:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="paste stack trace and/or log here"><pre class="notranslate"><span class="pl-en">paste</span> <span class="pl-en">stack</span> <span class="pl-en">trace</span> <span class="pl-k">and</span>/<span class="pl-en">or</span> <span class="pl-en">log</span> <span class="pl-en">here</span></pre></div>

<p dir="auto">I tested version &gt;= 4.4.0, when I click icon turn to MainActivity, has a crash.<br>
version &lt;= 4.3.1, no crash.<br>
MainActivity do nothing, only onCreate() { super.onCreate(); setContentView(R.layout.activity_main); }</p>
<p dir="auto">this is the crash log:<br>
03-02 15:12:33.452 1716-1897/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243<br>
03-02 15:12:33.458 1716-1897/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243<br>
03-02 15:12:33.459 612-2691/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only<br>
03-02 15:12:33.464 1716-3080/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity/243<br>
03-02 15:12:33.516 1716-3080/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.home/com.miui.home.launcher.Launcher/10000<br>
03-02 15:12:33.817 612-2691/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]<br>
03-02 15:12:34.721 2802-2802/? E/CardEmulation: AID 2PAY.SYS.DDF01 is not a valid AID.<br>
03-02 15:12:34.721 2802-2802/? E/ApduServiceInfo: Ignoring invalid or duplicate aid: 2PAY.SYS.DDF01<br>
03-02 15:12:34.732 2802-2802/? E/RegisteredServicesCache: Next Tag=services<br>
03-02 15:12:34.733 2802-2802/? E/RegisteredServicesCache: 1invalidateCache:WriteServiceStateToFile<br>
03-02 15:12:34.733 2802-2802/? E/RegisteredServicesCache:  Writing service state Data Always<br>
03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: component namecom.eg.android.AlipayGphone/com.alipay.android.phone.offlinepay.nfc.CardService<br>
03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: uid name10070<br>
03-02 15:12:34.739 2802-2802/? E/RegisteredServicesCache: service State:2<br>
03-02 15:12:34.889 2951-3259/? E/Launcher.AllAppsList: Can't load postion for packageName: innocent.test activityName: innocent.test.MainActivity<br>
03-02 15:12:35.059 612-2691/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only<br>
03-02 15:12:35.060 1716-11202/? E/ActivityTrigger: activityStartTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1<br>
03-02 15:12:35.063 1716-11202/? E/ActivityTrigger: activityResumeTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1<br>
03-02 15:12:35.065 1716-3173/? E/ActivityTrigger: activityResumeTrigger: not whiteListedinnocent.test/innocent.test.MainActivity/1<br>
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__)<br>
03-02 15:12:35.104 6811-6811/? E/JPush: [JPushGlobal] Get sdk version fail![获取sdk版本失败!]<br>
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<br>
03-02 15:12:35.124 2847-3066/? E/WtProcessController: Error pid or pid not exist<br>
03-02 15:12:35.346 6112-6112/? E/AndroidRuntime: FATAL EXCEPTION: main<br>
Process: innocent.test, PID: 6112<br>
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)<br>
at android.support.v7.widget.TintTypedArray.getFont(TintTypedArray.java:119)<br>
at android.support.v7.widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:208)<br>
at android.support.v7.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:110)<br>
at android.support.v7.widget.AppCompatTextHelperV17.loadFromAttributes(AppCompatTextHelperV17.java:38)<br>
at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:81)<br>
at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:71)<br>
at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:67)<br>
at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:753)<br>
at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261)<br>
at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243)<br>
at android.support.v7.widget.ActionBarOverlayLayout.setWindowTitle(ActionBarOverlayLayout.java:621)<br>
at android.support.v7.app.AppCompatDelegateImplV9.onTitleChanged(AppCompatDelegateImplV9.java:631)<br>
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)<br>
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)<br>
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)<br>
at innocent.test.MainActivity.onCreate(MainActivity.java:11)<br>
at android.app.Activity.performCreate(Activity.java:6861)<br>
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)<br>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)<br>
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2801)<br>
at android.app.ActivityThread.-wrap12(ActivityThread.java)<br>
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1548)<br>
at android.os.Handler.dispatchMessage(Handler.java:102)<br>
at android.os.Looper.loop(Looper.java:163)<br>
at android.app.ActivityThread.main(ActivityThread.java:6368)<br>
at java.lang.reflect.Method.invoke(Native Method)<br>
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)<br>
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791)<br>
03-02 15:12:35.365 2847-3066/? E/WtProcessController: Error pid or pid not exist<br>
03-02 15:12:35.366 1716-11135/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.home/com.miui.home.launcher.Launcher/10000<br>
03-02 15:12:35.478 14403-14495/? E/Market-LocalAppManager: [InvalidPackageList] JSON : list is null<br>
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<br>
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<br>
return value 2<br>
03-02 15:12:37.073 612-2691/? E/ANDR-PERF-RESOURCEQS: Failed to reset optimization [3, 0]<br>
03-02 15:12:37.719 941-1644/? E/Parcel: Reading a NULL string not supported here.</p>
<p dir="auto">this is my build.gradle of app:<br>
apply plugin: 'com.android.application'</p>
<p dir="auto">android {<br>
compileSdkVersion 26<br>
defaultConfig {<br>
applicationId "innocent.test"<br>
minSdkVersion 14<br>
targetSdkVersion 26<br>
versionCode 1<br>
versionName "1.0"<br>
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"<br>
}<br>
buildTypes {<br>
release {<br>
minifyEnabled false<br>
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'<br>
}<br>
}<br>
}</p>
<p dir="auto">dependencies {<br>
implementation fileTree(dir: 'libs', include: ['*.jar'])<br>
implementation 'com.android.support:appcompat-v7:26.1.0'<br>
implementation 'com.android.support.constraint:constraint-layout:1.0.2'<br>
testImplementation 'junit:junit:4.12'<br>
androidTestImplementation 'com.android.support.test<g-emoji class="g-emoji" alias="runner" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f3c3.png">🏃</g-emoji>0.5'<br>
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// 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'"><pre class="notranslate"><code class="notranslate">// 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'
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto"><strong>Glide Version</strong>: 4.0.0 SNAPSHOT from 10/22/2016</p>
<p dir="auto">How should I implement</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="requestManager.load(avatarUrl)
        .fitCenter()
        .placeholder(R.drawable.profile_photo_stub)
        .into(viewHolder.avatarImg);"><pre class="notranslate"><code class="notranslate">requestManager.load(avatarUrl)
        .fitCenter()
        .placeholder(R.drawable.profile_photo_stub)
        .into(viewHolder.avatarImg);
</code></pre></div>
<p dir="auto">using 4.x API?</p>
<p dir="auto">Looks like it should be something like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="requestManager.load(avatarUrl)
        .apply(RequestOptions.fitCenterTransform(getContext()))
        .apply(RequestOptions.placeholderOf(R.drawable.profile_photo_stub))
        .into(viewHolder.avatarImg);"><pre class="notranslate"><code class="notranslate">requestManager.load(avatarUrl)
        .apply(RequestOptions.fitCenterTransform(getContext()))
        .apply(RequestOptions.placeholderOf(R.drawable.profile_photo_stub))
        .into(viewHolder.avatarImg);
</code></pre></div>
<p dir="auto">but it seems too heavy and complex for me.</p>
<p dir="auto">Why <code class="notranslate">fitCenterTransform</code> requires context and doesn't get it from the <code class="notranslate">requestManager</code>?</p>