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

Proguard issues with 1.3.6/1.3.7 #2046

Closed
ZakTaccardi opened this issue May 21, 2020 · 8 comments
Closed

Proguard issues with 1.3.6/1.3.7 #2046

ZakTaccardi opened this issue May 21, 2020 · 8 comments
Assignees

Comments

@ZakTaccardi
Copy link

ZakTaccardi commented May 21, 2020

Seems that 1.3.6/1.3.7 bring in the -debug artifact, which causes compilation issues when minifying with proguard (using 6.2.2).

Output for 1.3.7:

Note: there were 17 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning: kotlinx.coroutines.debug.AgentPremain$DebugProbesTransformer: can't find superclass or interface java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find superclass or interface sun.misc.SignalHandler
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.SignalHandler
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain$DebugProbesTransformer: can't find referenced class java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find referenced class sun.misc.SignalHandlerNote: there were 17 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning: kotlinx.coroutines.debug.AgentPremain$DebugProbesTransformer: can't find superclass or interface java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find superclass or interface sun.misc.SignalHandler
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.SignalHandler
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain: can't find referenced class java.lang.instrument.Instrumentation
Warning: kotlinx.coroutines.debug.AgentPremain$DebugProbesTransformer: can't find referenced class java.lang.instrument.ClassFileTransformer
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find referenced class sun.misc.SignalHandler
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find referenced class sun.misc.Signal
Warning: kotlinx.coroutines.debug.AgentPremain$installSignalHandler$1: can't find referenced class sun.misc.Signal
Warning: there were 15 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sample:minifyReleaseWithProguard'.
> java.io.IOException: Please correct the above warnings first.

Issue does not reproduce with 1.3.5

@ZakTaccardi
Copy link
Author

May be related to #2023 somewhat

@ZakTaccardi
Copy link
Author

Note: this fixes the issue

-dontwarn java.lang.instrument.ClassFileTransformer
-dontwarn sun.misc.SignalHandler
-dontwarn java.lang.instrument.Instrumentation
-dontwarn sun.misc.Signal

But I'm not sure if that is a safe thing to do? Ideally the coroutines artifact would ship with these proguard rules if these -dontwarns are correct

@HeyAlex
Copy link

HeyAlex commented Jun 17, 2020

same problem

@qwwdfsad qwwdfsad self-assigned this Jun 17, 2020
@qwwdfsad
Copy link
Contributor

It is a safe thing to do, thanks for suggesting, we'll start shipping these rules along with core artifact

@mhmdreza
Copy link

same Problem.

@IgorGanapolsky
Copy link

-dontwarn java.lang.instrument.ClassFileTransformer
-dontwarn sun.misc.SignalHandler
-dontwarn java.lang.instrument.Instrumentation
-dontwarn sun.misc.Signal

I am still getting this build error:

Note: there were 45 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(https://www.guardsquare.com/proguard/manual/troubleshooting#dynamicalclass)
Warning: there were 6 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedprogramclassmember)

@tyvsmith
Copy link

When upgrading to 1.4, we saw this errors appeared in addition to this one on DelayKt.

Warning: kotlinx.coroutines.DelayKt: can't find referenced method 'double getZERO()' in program class kotlin.time.Duration$Companion Warning: there were 1 unresolved references to program class members. Your input classes appear to be inconsistent. You may need to recompile the code. (https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedprogramclassmember)

I've added -dontwarn kotlin.time.Duration$Companion as well as the others listed here to unblock.

dkhalanskyjb added a commit that referenced this issue Sep 29, 2020
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this issue Dec 28, 2020
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this issue Dec 28, 2020
@Ayfri
Copy link

Ayfri commented Jan 2, 2022

Still getting the problem in 1.6.0.
I have this error exactly :

Error: Missing class android.annotation.SuppressLint (referenced from: kotlinx.coroutines.debug.AgentPremain)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants