Reputation: 21
My APK created by Eclipse is 900K, but by Android Studio is 1.62MB. The code is same. Why? In Eclipse, I add facebook-sdk.jar, google-analytics.jar and other jars to my libs. In Android Studio, the two build.gradle are as follows:
build.gradle in project
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
jcenter()
}
}
build.gradle in module
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 21
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:support-v4:21.0.3'
// compile 'com.google.android.gms:play-services:7.5.+'
compile 'com.google.android.gms:play-services-analytics:7.5.0'
compile files('libs/stickylistheaders_lib.jar')
}
Upvotes: 2
Views: 782
Reputation: 2312
use this in build.gradle
the problem is in gradle build
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
Upvotes: 1