The Wayback Machine - https://web.archive.org/web/20201008063608/https://github.com/square/leakcanary/issues/1754
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Couldn't find outer class" with Proguard but not R8 #1754

Open
Walll-E opened this issue Feb 13, 2020 · 12 comments
Open

"Couldn't find outer class" with Proguard but not R8 #1754

Walll-E opened this issue Feb 13, 2020 · 12 comments

Comments

@Walll-E
Copy link

@Walll-E Walll-E commented Feb 13, 2020

Exception in thread "main" java.lang.NullPointerException: Couldn't find outer class leakcanary/internal/activity/screen/HeapAnalysisFailureScreen$createView$1$1 of leakcanary/internal/activity/screen/HeapAnalysisFailureScreen$createView$1$1$1
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:1079)
	at com.google.devtools.build.android.desugar.ClassVsInterface.isOuterInterface(ClassVsInterface.java:56)
	at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitOuterClass(InterfaceDesugaring.java:246)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:638)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
	at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
	at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
	at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
	at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
@Walll-E Walll-E added the type: bug label Feb 13, 2020
@pyricau
Copy link
Member

@pyricau pyricau commented Feb 13, 2020

This looks like a bug in desugar, which you should file to Google. Can you provide details on the version of Gradle you used and its configuration, as well as the version of LeakCanary? Also ideally if you could reproduce this with a sample project and provide it, it would be helpful. Without all this information there's not much we can do.

@EricLi22
Copy link

@EricLi22 EricLi22 commented Feb 18, 2020

This looks like a bug in desugar, which you should file to Google. Can you provide details on the version of Gradle you used and its configuration, as well as the version of LeakCanary? Also ideally if you could reproduce this with a sample project and provide it, it would be helpful. Without all this information there's not much we can do.

I have the same problemg . @pyricau
distributionUrl=https://services.gradle.org/distributions/gradle-4.4.1-all.zip
classpath 'com.android.tools.build:gradle:3.1.4'
Android Studio 3.5.3
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'

@pyricau
Copy link
Member

@pyricau pyricau commented Feb 19, 2020

Can you reproduce this with a sample project?

@pyricau pyricau closed this Feb 19, 2020
@pyricau pyricau reopened this Feb 19, 2020
@pyricau
Copy link
Member

@pyricau pyricau commented Mar 19, 2020

Closing due to no response. Happy to take a look if someone can provide a sample project that reproduces this issue.

@pyricau pyricau closed this Mar 20, 2020
@roman-nevr
Copy link

@roman-nevr roman-nevr commented Apr 13, 2020

I have the same issue with Proguard but with R8 everything is fine. unfortunately I can't use R8 yet

@pyricau pyricau reopened this Apr 21, 2020
@pyricau pyricau changed the title Compile error "Couldn't find outer class" with Proguard but not R8 Jun 4, 2020
@barriosnahuel
Copy link

@barriosnahuel barriosnahuel commented Jun 7, 2020

Hi!

I added this comment on #1354 and then I noticed that this issue is actually very similar to what happens to me.

I'm upgrading from LeakCanary v1.6.3 to v2.3 and Proguard fails with some missing references:

Edit from @pyricau: this was a long list of warnings which doesn't point to any actual error and made the issue harder to read so I removed it.

Using R8 instead make it works ok.

Hope it helps!

@pyricau
Copy link
Member

@pyricau pyricau commented Jun 7, 2020

This looks similar to arrow-kt/arrow#807 which was fixed by arrow-kt/arrow#926 and was apparently caused by https://youtrack.jetbrains.com/issue/KT-16084

The next steps here are to repro with https://github.com/roman-nevr/LeakCanaryFailSample and then change the failing code until the sample passes.

@pyricau
Copy link
Member

@pyricau pyricau commented Jun 7, 2020

@roman-nevr what command do you run to reproduce the failure?

@roman-nevr
Copy link

@roman-nevr roman-nevr commented Jul 3, 2020

@roman-nevr what command do you run to reproduce the failure?

I choose Develop Build Variant. or you can use ./gradlew assembleDevelop

@pyricau
Copy link
Member

@pyricau pyricau commented Aug 31, 2020

@roman-nevr there is no develop build type in the provided sample. I ran ./gradlew assembleDebug and got build success. Can you still reproduce it with the sample project you provided?

@pyricau
Copy link
Member

@pyricau pyricau commented Sep 17, 2020

I started looking into this but without the ability to repro there are simply too many nested lambdas, I can't go randomly poke at which lambdas to move.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.