Following this answer in order to convert a APK file into a JAR file , I am trying to remove the dead code in the JAR file (ex GlassVoice.apk) in order to remove unless methods and avoid this error (Unable to execute dex: method ID not in [0, 0xffff]: 65536).
I created a sample of application, including my only JAR file and all the method what I needed.
In order to do that, I use Proguard, but when I try to export my application, asked by Proguard for reducing the dead code.
Unfortunately it doesn't go well (as you can see below ). I just have one JAR file, no more.
Here is my proguard.cfg :
-injars libs/GlassVoice-dex2jar.jar
-outjars GlassVoice-dex2jar_out.jar
-printmapping mapping.txt
-verbose
-dontwarn android.support.v4.**
-dontwarn sun.misc.**
Here is my output:
[...]
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.DynamicSizeTextView: can't find referenced class com.google.android.glass.hidden.HiddenTextView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.DynamicSizeTextView: can't find referenced class com.google.android.glass.hidden.HiddenTextView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.FastScrollOverlay: can't find referenced method 'float getZoomOutFactor()' in class com.google.android.glass.widget.CardScrollView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.FastScrollOverlay: can't find referenced method 'float getScrollPosition()' in class com.google.android.glass.widget.CardScrollView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.FastScrollOverlay: can't find referenced method 'float getZoomScale()' in class com.google.android.glass.widget.CardScrollView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.FastScrollOverlay: can't find referenced method 'android.view.View getItemViewForChildAt(int)' in class com.google.android.glass.widget.CardScrollView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.VolumeControlDialog: can't find referenced method 'com.google.android.glass.widget.CardScrollGesturer getGesturer()' in class com.google.android.glass.widget.CardScrollView
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.VolumeControlDialog: can't find referenced class com.google.android.glass.widget.CardScrollGesturer
[2014-06-23 18:07:58 - HotWord] Warning: com.google.glass.widget.VolumeControlDialog: can't find referenced class com.google.android.glass.widget.CardScrollGesturer
[2014-06-23 18:07:58 - HotWord] You should check if you need to specify additional program jars.
[2014-06-23 18:07:58 - HotWord] Warning: there were 163 unresolved references to classes or interfaces.
[2014-06-23 18:07:58 - HotWord] You may need to specify additional library jars (using '-libraryjars').
[2014-06-23 18:07:58 - HotWord] Warning: there were 51 unresolved references to program class members.
[2014-06-23 18:07:58 - HotWord] Your input classes appear to be inconsistent.
[2014-06-23 18:07:58 - HotWord] You may need to recompile them and try again.
[2014-06-23 18:07:58 - HotWord] Alternatively, you may have to specify the option
[2014-06-23 18:07:58 - HotWord] '-dontskipnonpubliclibraryclassmembers'.
[2014-06-23 18:07:58 - HotWord] java.io.IOException: Please correct the above warnings first.
[2014-06-23 18:07:58 - HotWord] at proguard.Initializer.execute(Initializer.java:321)
[2014-06-23 18:07:58 - HotWord] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-06-23 18:07:58 - HotWord] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-06-23 18:07:58 - HotWord] at proguard.ProGuard.main(ProGuard.java:492)
Any issues ?