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.

Proguard issue: "DaggerApplication Can't find referenced class" (2.26)

See original GitHub issue

After migrating to 2.26 I started getting Proguard (not R8) obfuscation error:

Warning: dagger.android.DaggerApplication: can't find referenced class com.google.errorprone.annotations.ForOverride
Warning: dagger.android.DispatchingAndroidInjector: can't find referenced class com.google.errorprone.annotations.CanIgnoreReturnValue
Warning: dagger.android.package-info: can't find referenced class com.google.errorprone.annotations.CheckReturnValue
Warning: dagger.android.support.package-info: can't find referenced class com.google.errorprone.annotations.CheckReturnValue

I’ve noticed that 2.25 publishes proguard file within aar artifact: image but 2.26 seems to be missing it: image

So if I had to guess the output of the new ProguardProcessor doesn’t get added to output aar?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BaloghTamascommented, Feb 4, 2020

Is there any easy way to see which files does Proguard take into account? 🤔(similar to Merged Manifest view in Android Studio)

You can add -printconfiguration "build/outputs/mapping/configuration.txt" to your project Proguard rules. Although this would not specifically state the file’s name and path included (which would be great), it would list all the commands used, with all the places that are affected by it. Quite similar to Marged Manifest view, but without IDE support.

0reactions
danysantiagocommented, Feb 11, 2020

Seems like R8 will be enabled by default in AGP 4.0.0, so you can either enabled it now so that the rules get picked up correctly or add the rule yourself: -dontwarn com.google.errorprone.annotations.**.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proguard: can't find referenced class - Stack Overflow
In my case Android Studio froze while doing ProGuard on release build. I killed it. And after the restart I started to see...
Read more >
Why do I get “can't find referenced class” errors?
The error means that ProGuard or R8 could not find a certain class that comes from a dependency. In general ProGuard needs all...
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
Code shrinking (or tree-shaking): detects and safely removes unused classes, fields, methods, and attributes from your app and its library dependencies (making ...
Read more >
Troubleshooting ProGuard issues on Android - Medium
In some cases ProGuard can't know that a class or method is being used, ... See references to classes and methods in APK...
Read more >
ProGuard Troubleshooting
Problems while preverifying for Java Micro Edition ... Note: can't find dynamically referenced class: ProGuard can't find a class or interface that your ......
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