<p dir="auto"><strong>Glide Version</strong>: 4.0.0-RC0</p>

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


<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:<br>
I'm trying to migrate from v3 to v4. Most of the things looked good until I added <code class="notranslate">@GlideModule</code> into appropriate places and Glide's <code class="notranslate">annotationProcessor</code> to each of my Gradle modules.</p>
<p dir="auto">Problematic pieces of generated code are in <code class="notranslate">GlideRequests</code> - 2 <code class="notranslate">as</code> methods:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Override
  public &lt;ResourceType&gt; GlideRequest&lt;ResourceType&gt; as(Class&lt;ResourceType&gt; resourceClass) {
    return new GlideRequest&lt;&gt;(glide, this, resourceClass);
  }

@Override
  public &lt;ResourceType&gt; GlideRequest&lt;ResourceType&gt; as(Class&lt;ResourceType&gt; resourceClass) {
    return (GlideRequest&lt;ResourceType&gt;) super.as(resourceClass);
  }"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Override</span>
  <span class="pl-k">public</span> &lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">GlideRequest</span>&lt;<span class="pl-s1">ResourceType</span>&gt; <span class="pl-s1">as</span>(<span class="pl-smi">Class</span>&lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">resourceClass</span>) {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">GlideRequest</span>&lt;&gt;(<span class="pl-s1">glide</span>, <span class="pl-smi">this</span>, <span class="pl-s1">resourceClass</span>);
  }

<span class="pl-c1">@</span><span class="pl-c1">Override</span>
  <span class="pl-k">public</span> &lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">GlideRequest</span>&lt;<span class="pl-s1">ResourceType</span>&gt; <span class="pl-s1">as</span>(<span class="pl-smi">Class</span>&lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">resourceClass</span>) {
    <span class="pl-k">return</span> (<span class="pl-smi">GlideRequest</span>&lt;<span class="pl-smi">ResourceType</span>&gt;) <span class="pl-en">super</span>.<span class="pl-en">as</span>(<span class="pl-s1">resourceClass</span>);
  }</pre></div>
<p dir="auto">There are 3 glide modules in total:</p>
<ul dir="auto">
<li>1 <code class="notranslate">AppGlideModule</code> that disables manifest parsing in the application Gradle module</li>
<li>1 <code class="notranslate">LibraryGlideModule</code> that configures OkHttp integration  in the application Gradle module</li>
<li>1 <code class="notranslate">LibraryGlideModule</code> that registers some <code class="notranslate">ModelLoader</code>s in one of the library Gradle modules</li>
</ul>
<p dir="auto">Do not use any <code class="notranslate">GlideExtention</code>s or <code class="notranslate">GlideType</code>s.<br>
Tried to only apply <code class="notranslate">annotationProcessor</code> in the main application Gradle module but didn't change anything. Also tried to exclude OkHttp3 integration - no luck as well.</p>
<p dir="auto"><strong>Compilation error</strong>:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2870939/26652423/e1b9cd68-461d-11e7-8175-4d9834bdfed0.png"><img src="https://cloud.githubusercontent.com/assets/2870939/26652423/e1b9cd68-461d-11e7-8175-4d9834bdfed0.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Totally lost on what may be causing the issue.</p>
<p dir="auto"><strong>Glide Version</strong>: 4.0.0-RC0</p>

<p dir="auto"><strong>Integration libraries</strong>: okhttp-integration:4.0.0-RC0</p>

<p dir="auto"><strong>Device/Android Version</strong>: Galaxy S6 SDK version 25</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:<br>
When using an annotation processor, generated class GlideRequests contains duplicate field:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Override
  public &lt;ResourceType&gt; GlideRequest&lt;ResourceType&gt; as(Class&lt;ResourceType&gt; resourceClass) {
    return new GlideRequest&lt;&gt;(glide, this, resourceClass);
  }
  @Override
  public &lt;ResourceType&gt; GlideRequest&lt;ResourceType&gt; as(Class&lt;ResourceType&gt; resourceClass) {
    return (GlideRequest&lt;ResourceType&gt;) super.as(resourceClass);
  }"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Override</span>
  <span class="pl-k">public</span> &lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">GlideRequest</span>&lt;<span class="pl-s1">ResourceType</span>&gt; <span class="pl-s1">as</span>(<span class="pl-smi">Class</span>&lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">resourceClass</span>) {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">GlideRequest</span>&lt;&gt;(<span class="pl-s1">glide</span>, <span class="pl-smi">this</span>, <span class="pl-s1">resourceClass</span>);
  }
  <span class="pl-c1">@</span><span class="pl-c1">Override</span>
  <span class="pl-k">public</span> &lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">GlideRequest</span>&lt;<span class="pl-s1">ResourceType</span>&gt; <span class="pl-s1">as</span>(<span class="pl-smi">Class</span>&lt;<span class="pl-smi">ResourceType</span>&gt; <span class="pl-s1">resourceClass</span>) {
    <span class="pl-k">return</span> (<span class="pl-smi">GlideRequest</span>&lt;<span class="pl-smi">ResourceType</span>&gt;) <span class="pl-en">super</span>.<span class="pl-en">as</span>(<span class="pl-s1">resourceClass</span>);
  }</pre></div>
<p dir="auto">My module:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@GlideModule
public class GlideAppModule extends AppGlideModule {
	@Override
	public void applyOptions(Context context, GlideBuilder builder) {
		builder.setDiskCache(new InternalCacheDiskCacheFactory(context, 20 * 1024 * 1024));
	}

	@Override
	public boolean isManifestParsingEnabled() {
		return false;
	}
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">GlideModule</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">GlideAppModule</span> <span class="pl-k">extends</span> <span class="pl-smi">AppGlideModule</span> {
	<span class="pl-c1">@</span><span class="pl-c1">Override</span>
	<span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">applyOptions</span>(<span class="pl-smi">Context</span> <span class="pl-s1">context</span>, <span class="pl-smi">GlideBuilder</span> <span class="pl-s1">builder</span>) {
		<span class="pl-s1">builder</span>.<span class="pl-en">setDiskCache</span>(<span class="pl-k">new</span> <span class="pl-smi">InternalCacheDiskCacheFactory</span>(<span class="pl-s1">context</span>, <span class="pl-c1">20</span> * <span class="pl-c1">1024</span> * <span class="pl-c1">1024</span>));
	}

	<span class="pl-c1">@</span><span class="pl-c1">Override</span>
	<span class="pl-k">public</span> <span class="pl-smi">boolean</span> <span class="pl-en">isManifestParsingEnabled</span>() {
		<span class="pl-k">return</span> <span class="pl-c1">false</span>;
	}
}</pre></div>
<p dir="auto">Extension:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@GlideExtension
public final class GlideAppExtension {
	private GlideAppExtension() {}

	@GlideOption
	private static void cropCircle(RequestOptions options) {
		// TODO
	}
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">GlideExtension</span>
<span class="pl-k">public</span> <span class="pl-k">final</span> <span class="pl-k">class</span> <span class="pl-smi">GlideAppExtension</span> {
	<span class="pl-k">private</span> <span class="pl-smi">GlideAppExtension</span>() {}

	<span class="pl-c1">@</span><span class="pl-c1">GlideOption</span>
	<span class="pl-k">private</span> <span class="pl-k">static</span> <span class="pl-smi">void</span> <span class="pl-en">cropCircle</span>(<span class="pl-smi">RequestOptions</span> <span class="pl-s1">options</span>) {
		<span class="pl-c">// TODO</span>
	}
}</pre></div>
<p dir="auto">Should i use in build.gradle:<br>
<code class="notranslate">annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'</code><br>
or<br>
<code class="notranslate">compile 'com.github.bumptech.glide:compiler:4.0.0-RC0</code></p>
<p dir="auto">I've tried both, and tried SNAPSHOT version<br>
Also in the documentation example the first argument is RequestOptions&lt;?&gt;, but the class from the sources is not generic?</p>
<p dir="auto">Also in the code bellow, error drawable is not used when the url is null, and docs state: "null models will cause the error drawable to be displayed", this is working in the latest 3.x version.</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="GlideApp.with(this).load(contractImage) // contractImage is null
			        .transform(new CropCircleTransformation())
			        .error(errorDrawable)
			        .into(imageView);"><pre class="notranslate"><span class="pl-smi">GlideApp</span>.<span class="pl-en">with</span>(<span class="pl-smi">this</span>).<span class="pl-en">load</span>(<span class="pl-s1">contractImage</span>) <span class="pl-c">// contractImage is null</span>
			        .<span class="pl-en">transform</span>(<span class="pl-k">new</span> <span class="pl-smi">CropCircleTransformation</span>())
			        .<span class="pl-en">error</span>(<span class="pl-s1">errorDrawable</span>)
			        .<span class="pl-en">into</span>(<span class="pl-s1">imageView</span>);</pre></div>