将eclipse项目导入android studio,apk大小增加

时间:2016-03-29 10:29:11

标签: android android-studio

我将eclipse项目转换为android studio项目,apk大小增加到10mb到17mb。我不知道如何解决这个我的成绩档案,如下所示,

apply plugin: 'com.android.application'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}
dependencies {
    testCompile 'junit:junit:4.12'
    repositories {
        mavenCentral()
    }
    compile fileTree(dir: 'libs', include: '*.jar')
    androidTestCompile 'com.android.support.test:runner:0.3'
    androidTestCompile 'com.android.support.test:rules:0.4'

    compile 'com.jayway.android.robotium:robotium-solo:5.5.4'

}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    aaptOptions.setProperty("cruncherEnabled", false)

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }


        instrumentTest.setRoot('tests')

        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    android {
        packagingOptions {
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/LICENSE.txt'
        }
    }
buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

请帮助我获取apk文件的原始大小谢谢

1 个答案:

答案 0 :(得分:0)

专注于这一行:

compile 'com.jayway.android.robotium:robotium-solo:5.5.4'

它是机器人jar,不应该在build config debug / release中编译。

尝试将其修改为'androidTestCompile'。

androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.4'