将已签名的apk从android studio部署到设备

时间:2016-11-29 07:47:12

标签: java android gradle dependencies android-gradle

我正在尝试从android studio部署签名 apk。我已经使用所需的凭据配置了build.gradle,但是当我尝试构建.apk时,我收到了一些警告。我尝试在 proguard 规则中添加一些命令但仍然得到相同的警告。我该如何解决这个问题?

以下是该问题的图片。

enter image description here enter image description here

这是gradles文件。

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.neenbedankt.android-apt'
//apply plugin: 'com.google.gms.google-services'
android {
    signingConfigs {
        release {
            keyAlias 'something'
            keyPassword 'something'
            storeFile file('D:/something')
            storePassword 'something'
        }
    }
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.aam.skillschool"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.google.apis:google-api-services-youtube:v3-rev179-1.22.0'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.jakewharton:butterknife:8.4.0'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.jakewharton.timber:timber:4.3.1'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.google.code.gson:gson:2.8.0'
    testCompile 'junit:junit:4.12'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    apt 'com.jakewharton:butterknife-compiler:8.4.0'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    apt 'com.google.dagger:dagger-compiler:2.7'
    compile 'com.google.dagger:dagger:2.7'
    provided 'javax.annotation:jsr250-api:1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'br.com.mauker.materialsearchview:materialsearchview:1.2.0'
    compile 'com.google.http-client:google-http-client-android:+'
    compile 'com.google.api-client:google-api-client-android:+'
    compile 'com.google.api-client:google-api-client-gson:+'
}

提前致谢!

1 个答案:

答案 0 :(得分:1)

你已经被proguard删除了导入库的非使用类,恢复到你没有应用pro-guard的版本,该版本应该可以工作。然后仔细包括你所有库的所有例外和规则在你的保护规则,然后尝试使用proguard