bug: values.xml produces a Android resource linking failed
See original GitHub issueBug 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:
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:
Other Technical Details
npm --version
output: 7.21.1
node --version
output: v14.17.5
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
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:
using compileSdkVersion/targetSdkVersion 31 is not a good solution as Capacitor doesn’t support it yet and it’s not even official
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.