question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gradle cannot build project with org.scribe dependency when using proguard

See original GitHub issue

In build.gradle I have the following dependency on the org.scribe:scribe library: compile ‘org.scribe:scribe:1.3.5’

Building the release version of the app fails because the proguardRelease target fails:

 [exec] Warning: org.scribe.services.CommonsEncoder: can't find referenced class org.apache.commons.codec.binary.Base64
 [exec] Warning: org.scribe.services.CommonsEncoder: can't find referenced class org.apache.commons.codec.binary.Base64
 [exec] Warning: org.scribe.services.DatatypeConverterEncoder: can't find referenced class javax.xml.bind.DatatypeConverter
 [exec] Warning: org.scribe.services.DatatypeConverterEncoder: can't find referenced class javax.xml.bind.DatatypeConverter
 [exec] Warning: there were 4 unresolved references to classes or interfaces.
 [exec] 
 [exec] FAILURE: Build failed with an exception.         You may need to add missing library jars or update their versions.
 [exec]          If your code works fine without the missing classes, you can suppress
 [exec] 
 [exec] 
 [exec] * What went wrong:
 [exec] Execution failed for task ':proguardRelease'.
 [exec]          the warnings with '-dontwarn' options.> java.io.IOException: Please correct the above warnings first.
 [exec]          (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
 [exec] :proguardRelease FAILED

I’m not sure what the meaning of the error is.

I’ve seen this workaround of adding the following two lines to the proguard configuration file: (https://github.com/yasuoza/HBFav-Android/blob/master/HBFav/proguard-android-release.txt)

-dontwarn org.apache.commons.codec.binary.Base64 -dontwarn javax.xml.bind.DatatypeConverter

Is this ok? If so, could you update your readme.md? Thanks!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
kurtisnelsoncommented, Nov 5, 2014

Add to your proguard config. @fernandezpablo85 Might want to drop this in your README, anyone using scribe on Android will run into this on production builds, Android is missing these dependencies.

-dontwarn javax.xml.bind.DatatypeConverter
-dontwarn org.apache.commons.codec.binary.Base64
0reactions
truefedexcommented, Jun 9, 2017

I get this exception while using Twitter apis with proguarded app: java.lang.IllegalArgumentException: class com.github.a.b.e.b declares multiple JSON fields named a

Then I added this to my proguard configuration -keepclasseswithmembers class com.github.scribejava.core.** { *; } and error dissappeared

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle failed to build when proguard is activated
I've been battling this issue for the past few hours. Basically the proguard task will halt execution if there are any warnings.
Read more >
org.scribe : scribe : 1.3.5 - Maven Central Repository Search
Scribe OAuth Library ; Apache Maven maven.apache.org ; Gradle Groovy DSL gradle.org ; Gradle Kotlin DSL github.com/gradle/kotlin-dsl ; Scala SBT scala-sbt.org.
Read more >
Cannot apply ProGuard Gradle Plugin in an Android project
Hi I use Android Studio 4.1.2 to create a new project. And try to enable proguard by using ProGuard Gradle Plugin, ProGuard Manual:...
Read more >
16860 (Resolve all dependencies and tools using Apache Ivy)
CompressorStreamFactory$1: can't find referenced class org.apache.commons.compress.compressors.CompressorStreamFactory [proguard] Warning: ...
Read more >
Bugsnag docs › Build & deploy integrations › Gradle (Android)
This occurs when your project adds another gradle plugin to your buildscript classpath that itself has a dependency on a different version of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found