3

I'm using eclipse to compile a large project with more than 65k method count. I'm using proguard to reduce method count number as specified in official documentation: https://developer.android.com/tools/building/multidex.html

Remove unused code with ProGuard - Configure the ProGuard settings for your app to run ProGuard and ensure you have shrinking enabled for release builds. Enabling shrinking ensures you are not shipping unused code with your APKs.

It works fine because if i sign my app with my release key the method count reduces to 43K.

The problem is that if i try to launch my app with PLAY button (it means using debug.keystore, without signing it in release mode), eclipse is not using proguard and it is showing me this error without leaving me test my app:

Dex Loader Unable to execute dex: method ID not in [0, 0xffff]: 65536

It is mandatory for me to use Eclipse some months more, until we are prepared to migrate to Android Studio with this huge project, so i need to reduce method count when launching with debug mude, so i need to apply proguard launching in debug mode with eclipse. ¿How can it be donde?

Thanks

NullPointerException
  • 36,107
  • 79
  • 222
  • 382
  • Facebook developers had such problem. Maybe their experience would be helpful https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920 – Eugene Popovich Aug 17 '15 at 08:05
  • Thanks but we are not facebook, we need to achieve this without hacking android dalvik vm – NullPointerException Aug 17 '15 at 08:26

1 Answers1

0

If you are using Eclipse IDE it is not possible to Enable Proguard in Debug mode But if it possible to use Android Studio you can achieve this. visit-Is it possible to use proguard in debug mode?

Just a wild Idea:

1.Run proguard on your application in Release Mode and you will get usage.txt inside Proguard Folder.

2.Open the usage,txt which contains all code which is striped from the .apk.This code was striped from the .apk because it was not needed. So observe thoose methods. 3.Now you can mannually delete those methods from your code and may be it could solve the maximum number of method count.

Community
  • 1
  • 1