gradle cannot build project with org.scribe dependency when using proguard
See original GitHub issueIn 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:
- Created 9 years ago
- Comments:9
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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