【问题标题】:Android Studio Can not generate signed APK fileAndroid Studio 无法生成签名的 APK 文件
【发布时间】:2016-01-08 16:05:12
【问题描述】:

每个人,我都在尝试使用 android studio 生成一个签名的 APK 文件,首先,我将“构建变体”从调试更改为发布,然后在 Grade.app minifyEnabled 上设置为 true,最后我创建了我的密钥和我的密码,直到这里一切正常,但在我最后一次点击时,Android Studio 尝试生成文件,但出现此消息

警告:com.google.android.gms.auth.GoogleAuthUtil:找不到引用的方法 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent )' 在库类 android.app.Notification 中

警告:对库类成员有 1 个未解决的引用。 您可能需要更新库版本。 (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember) :app:proguardRelease 失败

FAILURE:构建失败并出现异常。

出了什么问题: 任务“:app:proguardRelease”执行失败。 java.io.IOException: 请先更正上述警告。

尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

构建失败

我对这个软件太新了,所以请耐心等待我,我不知道我应该更新哪些库。 我的 compileSdkVersion 是 23,我的目标 sdk 版本是 23。

谢谢大家。

这是我的 build.grade 文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.example.manuelrios.aplicacion_inmobiliaria"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:4.2.42'
}

【问题讨论】:

  • 粘贴你的 build.grade 文件
  • 在语法上看起来不错。尝试运行./gradlew clean assembleRelease -d,看看你得到了什么异常,如果有的话。我能看到的唯一另一件事是您的播放服务版本很旧。目前最新版本为 7.8.0 或更高版本。尝试改变它。
  • 解决了,我把 -dontwarn org.apache.http.** -dontwarn android.net.http.AndroidHttpClient -dontwarn com.google.android.gms.** -dontwarn com.android.volley .toolbox.**
  • @NicoleArévalo,您应该将该评论作为答案,然后接受它作为答案。

标签: android android-studio proguard


【解决方案1】:

在您的应用程序 gradle 中添加以下代码

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"
    .        
    .
    .
    lintOptions {
         checkReleaseBuilds false
    }
}

【讨论】:

    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 2016-09-11
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    相关资源
    最近更新 更多