question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: values.xml produces a Android resource linking failed

See original GitHub issue

Bug Report

Capacitor Version

╰─ npx cap doctor 💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 3.2.4

@capacitor/core: 3.2.4

@capacitor/android: 3.2.4

@capacitor/electron: 3.2.4

@capacitor/ios: 3.2.4

Installed Dependencies:

@capacitor/cli 2.0.1

@capacitor/android 2.4.0

@capacitor/ios 2.4.0

@capacitor/core 2.4.0

@capacitor/electron 2.4.0

Platform(s)

Android

Current Behavior

When I build the app in Android studio I get the following error:

image

This is only happening when I have plugins in the project, if I remove all the plugins the app builds correctly.

To set up the project I’ve followed the documentation: Updating Capacitor to 2.0 in your app ( https://capacitorjs.com/docs/updating/2-0 )

This is my variables.gradle:

ext {
  minSdkVersion = 28
  compileSdkVersion = 30
  targetSdkVersion = 30
  androidxAppCompatVersion = '1.1.0'
  androidxCoreVersion =  '1.2.0'
  androidxMaterialVersion =  '1.1.0-rc02'
  androidxBrowserVersion =  '1.2.0'
  androidxLocalbroadcastmanagerVersion =  '1.0.0'
  firebaseMessagingVersion =  '20.1.2'
  playServicesLocationVersion =  '17.0.0'
  junitVersion =  '4.12'
  androidxJunitVersion =  '1.1.1'
  androidxEspressoCoreVersion =  '3.2.0'
  cordovaAndroidVersion =  '7.0.0'
}

I’m using the following version of Gradle and the Gradle plugin:

image

Other Technical Details

npm --version output: 7.21.1 node --version output: v14.17.5

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jcesarmobilecommented, Sep 30, 2021

yeah, looks like some plugin is pinning “latest” androidx.core library, which is picking 1.7.0-alpha02 and that causes the issue. or if using jetifier it’s also assigning that as latest

More info: https://www.reddit.com/r/Unity3D/comments/ph2596/android_builds_fail_due_to_core170alpha02_release/

A possible solution is to add this the the build.gradle:

configurations.all {
  resolutionStrategy {
    force 'androidx.core:core:1.6.0'
    force 'androidx.core:core-ktx:1.6.0'
  }
}

using compileSdkVersion/targetSdkVersion 31 is not a good solution as Capacitor doesn’t support it yet and it’s not even official

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android resource linking failed (AAPT2 27.0.3 Daemon #0) ...
According to the above error, the first thing you need to do is to proof read all the drawable resources that are accessed...
Read more >
Android resource linking failed error in android studio - YouTube
In this video i solve a major but most common error of android studio watch it and comment down below if you face...
Read more >
[ConstraintLayout 2.0.0-alpha1] Using ... - Issue Tracker
[ConstraintLayout 2.0.0-alpha1] Using ConstraintLayout 2 Alpha1 alongside Navigation file with arguments causes Android resource linking failure.
Read more >
Android resource linking failed: How do I fix this error?
Go through all your XML files and resolve errors, then clean or rebuild the project from the build menu. Start with your most...
Read more >
Android: Resource linking fails on lStar · Issue #491
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade. Android resource linking failed
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found