Android Studio 无法生成签名的 APK 文件 [英] Android Studio Can not generate signed APK file

查看:41
本文介绍了Android Studio 无法生成签名的 APK 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Everybody, im trying to generate a signed APK file , with android studio, Firts of all, I changed the "Build variant" from debug to release, then on grade.app minifyEnabled i put true, finally I created my Key and my password, and everything is alright until here, but on my last click, Android studio trys to generate the file but this message comes out

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

Warning: com.google.android.gms.auth.GoogleAuthUtil: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification

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

Warning: there were 1 unresolved references to library class members. You probably need to update the library versions. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember) :app:proguardRelease FAILED

FAILURE:构建失败,出现异常.

FAILURE: Build failed with an exception.

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

What went wrong: Execution failed for task ':app:proguardRelease'. java.io.IOException: Please correct the above warnings first.

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

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

构建失败

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

im too new with this software , so please be patient with me, i dont know which libraries should i Update. My compileSdkVersion is 23, and my targed sdk version is 23.

谢谢大家.

这是我的 build.grade 文件

here is my build.grade file

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'
}

推荐答案

在你的 app gradle 中添加以下代码

Add the below code in your app gradle

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

这篇关于Android Studio 无法生成签名的 APK 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆