I found out that every watch face i made did have a release apk file that never goes under 6Mo. Even when it does not contain any drawable. Even the default watch face project is about 6Mo once published & signed.
I assume it is an issue of Android Studio, because some watch face on the store are far lower than 6Mo (ex: Circles Watch Face is about 1.9Mo!!)
I found out that in the intermediate manifest of the mobile package, the following lines are added by the merger:
<activity
android:name="android.support.v7.widget.TestActivity"
android:label="RecyclerViewTestActivity" />
Even with a "tools:node="remove"", it is still added. And with this activity are added a full bunch of ressources (png, values) that I did not use.
Build.gradle of mobile package:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "fr.test"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services:7.0.0'
compile "com.google.android.support:wearable:1.1.+"
}
Did someone experienced the same issue and is there a solution to avoid this or reduce the apk size (an option I missed...)?
There 2 ways to go:
Reduce size using only needed parts of GP services:
Use proguard - it will cut all unused code
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}