Closed GoogleCodeExporter closed 9 years ago
Original comment by yan...@google.com
on 8 Jan 2011 at 6:19
Original comment by yan...@google.com
on 26 Jan 2011 at 3:07
Original comment by yan...@google.com
on 27 Jan 2011 at 8:34
"with ProGuard this will presumably reduce to a trivial size"
From a practical standpoint I can hardly agree with that claim. My APK is
~430kB with version 1.2.x of the library. Same code, bar the small changes
required to match the new API, is almost twice the size (800kB) with version
1.3.x of the library. This is not trivial by any standard.
Both builds use the attached ProGuard config.
I think this library should either repackage Guava into separate files or
import only those parts of Guava that it really needs, as was the case in the
1.2.x tree.
Original comment by ptas...@gmail.com
on 21 Apr 2011 at 11:12
Attachments:
For reference the calendar-v2-atom-android sample linked below compiles to
shrinks to a roughly 40KB application with the Guava dependency:
http://samples.google-api-java-client.googlecode.com/hg/calendar-v2-atom-android
-sample/instructions.html?r=default
So I suspect it is not a "dependency on guava" issue. It would be very
surprising to me since the amount of guava code actually used by the library is
trivially small.
That said, your ProGuard file looks good to me, and it is clear that you are
measuring the ProGuard size since otherwise it would be a lot more than 800kB.
What I recommend you do as the next step is to take a look at the mapping.txt
file that proguard generated and try to debug what ProGuard is actually
retaining. For example, how much of com.google.common is being used? If
possible, please attach the subset of the mapping.txt file that you are able to
share, at least for the non-confidential parts involving com.google.common.
Original comment by yan...@google.com
on 21 Apr 2011 at 12:01
Now this is puzzling. Based on ProGuard output none of com.google.common is
used. Yet, if I remove guava as a dependency for the project, and thus reduce
app size do ~476kB, the resulting APK fails immediately when the
google-api-java-client libary functionality is invoked. Excuse my ignorance,
but even if none of guava is used the dependency remains?
What's even more puzzling is that with the older 1.2.x release, under same
build process, the library was hardly adding any weight to the APK, somewhere
around 25kB at most.
I am using ant 1.8 for my builds and include 3rd party libs the standard way -
"libs" folder in project path + a pointer to the lib file in Eclipse project
classpath.
This makes me wonder, whether the way the library is referenced in a standard
Eclipse project should change for 1.3, compared to 1.2?
Original comment by ptas...@gmail.com
on 27 Apr 2011 at 2:48
As a test I have setup a blank "hello world" project and let Maven take care of
dependencies. This is how it looks like in the pom.xml file:
<dependency>
<groupId>com.google.api.client</groupId>
<artifactId>google-api-client-googleapis</artifactId>
<version>1.3.1-alpha</version>
<exclusions>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
</exclusions>
</dependency>
There is no code that calls any of the client API, so technically speaking the
resulting APK should be very small. It's not the case, as the APK ends up being
400kB. Removing the com.google.api.client dependency results in a 16kB APK. If
two different build models (ant v. maven) result in the same problem, it would
seem there might indeed be a problem with how the new version is packaged.
Original comment by ptas...@gmail.com
on 3 May 2011 at 1:29
Original issue reported on code.google.com by
yan...@google.com
on 7 Jan 2011 at 3:42