Android资源链接失败AAPT:未知选项'--no-proguard-location-reference' [英] Android resource linking failed AAPT: unknown option '--no-proguard-location-reference'

查看:289
本文介绍了Android资源链接失败AAPT:未知选项'--no-proguard-location-reference'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建APK时遇到问题.

Getting issue when trying to build apk.

Android Studio版本-4.0(最近更新的AS)

Android studio version - 4.0 (recently updated AS)

此过程显示了构建中的错误-:app:processDebugResources Android资源链接失败 AAPT:未知选项"--no-proguard-location-reference".

This process shows the error in build - :app:processDebugResources Android resource linking failed AAPT: unknown option '--no-proguard-location-reference'.

aapt2链接[选项] -o arg --manifest arg文件...

aapt2 link [options] -o arg --manifest arg files...

选项: -o arg输出路径. --manifest arg要构建的Android清单的路径. -I arg添加要链接的Android APK. -A arg要包含在APK中的资产目录

Options: -o arg Output path. --manifest arg Path to the Android manifest to build. -I arg Adds an Android APK to link against. -A arg An assets directory to include in the APK

尝试通过Android Studio中构建"菜单中的构建APK"选项构建APK

Trying to build apk by with Build APK option from Build Menu in android studio

Gradle项目文件

Gradle project file

classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"

推荐答案

(如果有):"_internal_aapt2_binary";在gradle文件中(对于gradle的早期版本),只需将其删除即可.

if you have : "_internal_aapt2_binary" in gradle file (for earlier versions of gradle) then just remove that.

configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
    config.resolutionStrategy.eachDependency { details ->
        details.useVersion("3.5.0-alpha03-5252756")
    }
}

这篇关于Android资源链接失败AAPT:未知选项'--no-proguard-location-reference'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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