Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add jar file path added in library project in PROGUARD

I have started including proguard in my project. But getting few warning. I am able to eliminate the warning by adding -dontwarn com.google.**. in proguard.cfg file. Every thing is okk, but I want to eliminate the -dontwarn command entirely from my project. After some investigation I found out these warning is there because I have added a jar in my library project. Now I have few questions here.

1) Do I need to add anything in my project properties for progurad to work on my library project. And also doesn't add any warning (As per my research I dont need to I guess. Refer to this url)

2) Since my guava.jar is added in my library project, Do I need to some command in my application proguard.cfg file to add library path like -libraryjars. If yes, how do I add the -libraryjars . I am talking about path at this instance. What path should I include or whats the syntax of adding path of the jar which is there in my library project?

Just for refrence I am adding error log.

[2014-12-11 18:00:26 - MyProject] Proguard returned with error code 1. See console
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Function: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Function: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$ConstantFunction: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$ConstantFunction: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$ConstantFunction: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$ForMapWithDefault: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$ForMapWithDefault: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$FunctionComposition: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$FunctionForMapNoDefault: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Functions$PredicateFunction: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Joiner: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects$ToStringHelper: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Objects$ToStringHelper: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.PairwiseEquivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.PairwiseEquivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.PairwiseEquivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.PairwiseEquivalence: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Platform: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Preconditions: can't find referenced class javax.annotation.Nullable
[2014-12-11 18:00:26 - MyProject] Warning: com.google.common.base.Preconditions: can't find referenced class javax.annotation.Nullable
 more few hundred lines of error.

Can anybody help me in this? Any help will be appreciated.

like image 614
Android Avatar asked Dec 11 '14 13:12

Android


1 Answers

The warnings are harmless in this case: the missing class is not necessary for the correct processing or execution of your code. You can either add the jar that contains javax.annotation.Nullable as a dependency in your project, or you can suppress the warnings. This works indeed:

-dontwarn com.google.**

Alternatively, this is slightly more succinct:

-dontwarn javax.annotation.Nullable
like image 151
Eric Lafortune Avatar answered Nov 03 '22 02:11

Eric Lafortune