Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android resource linking failed AAPT: unknown option '--no-proguard-location-reference'

Getting issue when trying to build apk.

Android studio version - 4.0 (recently updated AS)

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

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

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

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

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"
like image 724
Deepak Rathi Avatar asked Jun 12 '20 18:06

Deepak Rathi


People also ask

What is Android resource linking failed?

The Android resource linking failed error can also occur if you have an error in any of your XML resources.

What is AAPT error in Android Studio?

AAPT: Error: failed writing to '… \app\build\intermediates\runtim_symbol_list\debug\R. txt': … Error log. The cause of this issue is all about the combination of Android Gradle Plugin Version and Gradle Version.


1 Answers

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")
    }
}
like image 192
Charodey Avatar answered Nov 07 '22 15:11

Charodey