Glide: OkHttp3 integration lib wrong pom xml

Created on 29 Jan 2016  路  16Comments  路  Source: bumptech/glide

It seems like something has gone wrong while deploying the OkHttp3 integration to the Maven repos

http://repo1.maven.org/maven2/com/github/bumptech/glide/okhttp3-integration/1.4.0/okhttp3-integration-1.4.0.pom

<dependencies>
    <dependency>
      <groupId>glide-parent</groupId>
      <artifactId>library</artifactId>
      <version>unspecified</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>3.0.1</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

The dependency to Glide itself is wrong and doesn't work.

Workaround for now:

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile ('com.github.bumptech.glide:okhttp3-integration:1.4.0'){
        exclude group: 'glide-parent'
    }

1.5.0 is released, there should be no workaround needed

bug non-library

Most helpful comment

Try 1.5.0-SNAPSHOT, see https://github.com/bumptech/glide/wiki/Snapshots#gradle
Try 1.5.0, the bug should be fixed after that.

repositories {
  jcenter()
  /*maven { // needed for Glide -SNAPSHOT versions
    name 'glide-snapshot'
    url 'http://oss.sonatype.org/content/repositories/snapshots'
  }*/
}
dependencies {
  compile 'com.github.bumptech.glide:glide:3.7.0'
  compile 'com.github.bumptech.glide:okhttp3-integration:1.5.0' // no @aar
}

All 16 comments

Yep, good catch. When backporting we missed a dependency change in gradle.

Try 1.5.0-SNAPSHOT, see https://github.com/bumptech/glide/wiki/Snapshots#gradle
Try 1.5.0, the bug should be fixed after that.

repositories {
  jcenter()
  /*maven { // needed for Glide -SNAPSHOT versions
    name 'glide-snapshot'
    url 'http://oss.sonatype.org/content/repositories/snapshots'
  }*/
}
dependencies {
  compile 'com.github.bumptech.glide:glide:3.7.0'
  compile 'com.github.bumptech.glide:okhttp3-integration:1.5.0' // no @aar
}

:+1: thx!

Which should I use? Glide Integration Okhttp3
This dont work.
Error:Could not find glide-parent:library:unspecified.

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0'

With this dependencies fix error:
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'

see https://futurestud.io/blog/glide-integrating-networking-stacks

But its all ? This work ? What is the difference?

Or I need to use a SNAPSHOT
@TWiStErRob Try 1.5.0-SNAPSHOT, see https://github.com/bumptech/glide/wiki/Snapshots#gradle

The opening comment says "Workaround for now:", just copy that into your build.gradle.

@aar is the suggested way, it means that the build will merge the manifest of the library into your app, which results in using OkHttp 3 by default.
Without the @aar this merging doesn't happen, and you can customise the behaviour, e.g. the OkHttpClient to use to add interceptors.

Thats good, I need merge the GlideModule in manifest to use OkHttp3 by default.
So with this configuration work.
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
I was just confused.
Thanks @TWiStErRob for the answer.

need help~ thx! Error:Failed to resolve: glide-parent.third_party:gif decoder:unspecified

@jakingting open a new issue and fill in the details. Ah, never mind, just saw you already opened #1464.

@TWiStErRob
Could you please release the fix to jCenter? Cause @aar can't put in POM xml which cause our SDK have to copy & paste the source into each module.

@b95505017

Cause @aar can't put in POM xml

Ouch, long time since I heard POM and Android mentioned together :)
Try <type>jar</type> (or maybe aar, not sure how much the Ant/Eclipse build system advanced in the last few years), under the <dependency>, and add the single line into AndroidManifest.xml to include the GlideModule.

See https://github.com/bumptech/glide/wiki/Integration-Libraries#okhttp-3

@TWiStErRob Nope, I mean our SDK (published on jCenter) use okhttp3-integration as one of the dependency, just like the way you declare okhttp3 as dependency (pom.xml) in okhttp3-integration.

For customers who use our SDK will also download the dependency of okhttp3-integration causing compile error.

Our SDK
|--- com.github.bumptech.glide:okhttp3-integration:1.4.0
       |--- glide-parent:library:unspecified

@b95505017 I still think that specifying <type> may resolve the issue, did you try it? (I didn't.)

While the release happens another workaround for you could be to depend on a specific build of 1.5.0-SNAPSHOT in you SDK. (see possible versions at https://oss.sonatype.org/content/repositories/snapshots/com/github/bumptech/glide/okhttp3-integration/1.5.0-SNAPSHOT/)

@TWiStErRob I tried <type> aar but in vain, gradle will still try to download everything. I'll try jar later.
Declare SNAPSHOT ver. means that our customers have to add Sonatype repo manually, which is unacceptable for our spec.

@b95505017 oh, true that, I forgot about the repo.

@b95505017 3.8.0 is out, and hence 1.5.0 should be available as well!

@TWiStErRob
throwing me error can u please help me out,

FATAL EXCEPTION: main Process: com.glidemodule, PID: 6039 java.lang.UnsupportedOperationException at java.util.Collections$UnmodifiableCollection.add(Collections.java:1097) at com.glidemodule.helpers.OkHttpProgressGlideModule.registerComponents(OkHttpProgressGlideModule.java:35)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenneth2008 picture kenneth2008  路  3Comments

Ncit picture Ncit  路  3Comments

kooeasy picture kooeasy  路  3Comments

sant527 picture sant527  路  3Comments

mttmllns picture mttmllns  路  3Comments