由于某些警告,无法生成签名的APK

时间:2016-11-22 10:40:34

标签: android signed-apk

在生成已签名的APK时,我得到了这些警告

Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ManagementFactory
Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ThreadMXBean
Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ThreadMXBean
Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ManagementFactory
Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ThreadMXBean
Warning: org.junit.internal.runners.statements.FailOnTimeout: can't find referenced class java.lang.management.ThreadMXBean
Warning: org.junit.rules.DisableOnDebug: can't find referenced class java.lang.management.ManagementFactory
Warning: org.junit.rules.DisableOnDebug: can't find referenced class java.lang.management.RuntimeMXBean
Warning: org.junit.rules.DisableOnDebug: can't find referenced class java.lang.management.ManagementFactory
Warning: org.junit.rules.DisableOnDebug: can't find referenced class java.lang.management.RuntimeMXBean

我应该怎么做才能避免这些警告?在此先感谢您的帮助。

1 个答案:

答案 0 :(得分:5)

在proguard-rules.pro文件中添加

-dontwarn java.lang.management.**

可以避免此警告