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.

Okio 2.1.0 / Proguard issue

See original GitHub issue

Took me a while to figure out what was the cause as the issue does not occurs on my CI but updating Okio from 2.0.0 to 2.1.0 cause proguard 6.0.3 on my windows dev machine to goes nuts.

I fear you won’t have any idea and I have no idea how to debug that but with Okio 2.1.0 + Moshi 1.7 (And 1.6) + Okhttp 3.11 + some basic okio code in kotlin in my code like

response.body()?.use { body ->
                    return ByteArrayOutputStream().run {
                        this.sink().buffer().use { it.writeAll(body.source()) }
                        toByteArray()?.also { close() }
                    }
                }

Cause proguard to be stuck for infinite time at Optimizing (pass 1/5)… step. Gradle debug mode does not show any issue during that time, just the usual memory checks without any memory issues.

Reverting to 2.0.0 fix the issue.

R8 from AGP 3.2 have an issue I reported that was unfortunately not fixed in time, and R8 from 3.3a12 does compile but Moshi is no more working (was previously when I helped the Google team fixing the R8 issue) and I have not yet found (searched) the cause but maybe it’s tied. (Moshi generates {} instead of correct objects).

Edit: Tested 2.0.0 with R8 AGP 3.3a12 and same json issue so proguard issue not related to R8 issue that I’ll investigate later.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:33 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
shashachucommented, Apr 23, 2019

For future readers: the issue was that we have a buildSrc/build.gradle file. I had to set implementation "net.sf.proguard:proguard-base:6.1.0beta1" inside of that file.

2reactions
Tolriqcommented, Nov 10, 2018

For the others, confirmed as working with proguard 6.1 B1.

To test add in your buildscript

 configurations.all {
        resolutionStrategy {
            force("net.sf.proguard:proguard-base:6.1.0beta1")
        }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error on enabling Proguard - android - Stack Overflow
I have used my custom file for Proguard in my root directory. file name: cus-proguard-android.txt. I just copied the default file from
Read more >
738 Error after adding Kotlin to existing Android app
I am using latest proguard beta. Not using rxjava or any other starnge libraries. Just android and kotlin. why i this happening ?...
Read more >
Type com.squareup.moshi.RecordJsonAdapter$1 is defined ...
R8 is a new Android code shrinker. If you experience any issues, please file a bug at https://issuetracker.google.com , using 'Shrinker (R8)' as ......
Read more >
com.squareup.okio » okio » 2.1.0 - Maven Repository
Okio » 2.1.0 ; jar (164 KB) View All · Central · #260 in MvnRepository (See Top Artifacts) #2 in I/O Utilities ·...
Read more >
Change Log - LeakCanary - Square Open Source
#2310 Fixed crash when using WorkManager < 2.1.0. ... a quick follow up to 2.8 which had a few major issues . ......
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