Eclipse Export Signed Package adds drawables directory twice, doubling apk size!

I noticed this since about 2.1. I believe the problem is connecting Eclipse Export to APK or somewhere in my setup (although I have no idea where this could be).

Basically, all of a sudden my APK sizes doubled! Some research has revealed that Eclipse now includes a drop-down directory (and source, layout, and XML directories) twice. It includes it once under the res subdirectory and once under the root directory of the application.

So, instead of the directory structure, for example:

- com - META-INF - res - drawable - layout - raw - xml ... 

I have:

 - com - drawable - layout - META-INF - raw - res - drawable - layout - raw - xml - values - values-fr - xml 

Has anyone else experienced this? Does anyone know why this could be? This increased my application size from 3 MB to more than 6 MB, which is very important.

My current workaround is to export an unsigned package with eclipse, delete drawing, layout, raw and xml files from the root directory, then manually sign it and zipalign.

If you want to see the apk, look at this apk (with the problem) and this apk (which I fixed manually) . Both work, one twice as much.

I am using the Eclipse SDK, Version: 3.5.2, Build id: M20100211-1343, Android Development Toolkit Version: 10.0.1.v201103111512-110841, although I had a problem for the last two ADTs, since 2.1 came out. It doesn't seem to matter what level of APK I'm compiling.

Thanks for any help, insight!

+4
source share
1 answer

I finally decided it!

For some reason, an error occurred in my .classpath file, I never edited this file myself, but it must have slipped in all migrations between machines, eclipse versions and SDK versions.

He was reading:

  <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="res"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry kind="src" path="gen"/> <classpathentry kind="output" path="bin/classes"/> </classpath> 

Change it to:

  <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="gen"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> <classpathentry kind="output" path="bin/classes"/> </classpath> 

The problem is fixed. Yippee!

+4
source

All Articles