Reputation:
When I first noticed that I have reached maximum level of methods, I started to think what I should remove from dependencies. I assumed that I don't have to use support libraries because my min target is 17.
I changed Activities from AppCompatActivity to Activity, removed support v7 dependency, but problem occured in styles, because this style @android:style/Theme.Holo.Light.DarkActionBar"
gives old action bar.
So I am wondering, how to get newer action bar, and is it good practice to remove support library?
Upvotes: 1
Views: 96
Reputation: 29260
I think you would be better off using the AppCompatActivity so you adhere to material design guidelines. If you reach the DEX limit, you can use minify in proguard and/or multidex, to split your DEX into two or more separate DEX files under the 64K limit each. Adding multidex is very simple now, you can see here
Upvotes: 0
Reputation: 7918
There's 2 solutions to your issue.
1) Use Activity instead of AppCompatActivity, but then you'll only have the "newer" actionbar in API level 21+ (Because it's only supported in 21+).
To do this you'll have to setup different style sheets for API 17+ and API 21+, so API 17-20 will use the old style, and 21+ will use the new one.
2) Use AppCompatActivity, and keep the "newer" actionbar on all API levels, and then enable Proguard. Proguard will remove all unused classes, methods, etc. This will get you far below the limit. It takes a bit to set up correctly, but is by far the best way to fix your problem.
I haven't set it up recently, but google should be able to help you out with that.
Upvotes: 2