【问题标题】:Can't generate APK from Android Studio无法从 Android Studio 生成 APK
【发布时间】:2014-07-23 18:29:41
【问题描述】:

我正在尝试生成一个 APK。我去Build -> Generate signed APK,毕竟我收到了这条消息:

错误:发现任务 ':app:packageRelease' 的配置有问题。 为属性“signingConfig.storeFile”指定的文件“geovanni_geopath_keystore_02”不存在。

谁能帮帮我?谢谢

编辑

这是我的build.gradle文件,不知道哪里错了:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.geopath"
        minSdkVersion 14
        targetSdkVersion 19
    }



    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.google.code.gson:gson:2.2.2'
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/mobileservices-1.1.5-javadoc.jar')
    compile files('libs/mobileservices-1.1.5-sources.jar')
    compile files('libs/mobileservices-1.1.5.jar')
}

【问题讨论】:

  • 检查您的build.gradle 文件是否指定了您的密钥库文件路径

标签: android android-studio apk


【解决方案1】:

你可以试试这个:

根据 gradle 文档,你应该在 buildToolsVersion 之后的 android 部分添加这个:

signingConfigs {
    debug {
        storeFile file("debug.keystore")
    }
}

release {
    storeFile file("release.keystore")
    storePassword "paste your own password"
    keyAlias "paste your own alias"
    keyPassword "paste your own password"
}

并在项目目录中添加 debug.keystore 和 release.keystore(optionaly)。

【讨论】:

    猜你喜欢
    • 2018-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-21
    • 2016-09-07
    • 1970-01-01
    • 2016-09-11
    • 2019-03-29
    相关资源
    最近更新 更多