Cordova suddenly stopped building on Android: failed writing to '.\platforms\android\app\build\intermediates\runtime_symbol_list\debug\R.txt': Invalid Data. (13).
See original GitHub issueI am writing a small app in cordova and everything was working fine until yesterday when I tried to run cordova build android --release
Since then I always get this when I try to build for android:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\android\Sdk (recommended setting)
ANDROID_HOME=C:\android\Sdk (DEPRECATED)
Using Android SDK: C:\android\Sdk
Subproject Path: CordovaLib
Subproject Path: app
> Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
AAPT: error: failed writing to 'C:\Users\Inspiron 15\Desktop\project\platforms\android\app\build\intermediates\runtime_symbol_list\debug\R.txt': Invalid Data. (13).
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
26 actionable tasks: 26 executed
Command failed with exit code 1: C:\Users\Inspiron 15\Desktop\project\platforms\android\gradlew cdvBuildDebug -b C:\Users\Inspiron 15\Desktop\project\platforms\android\build.gradle
I am on windows 10, using cordova 10.0.0. The only plugins for the moment are: cordova-plugin-file cordova-plugin-whitelist
I have tried to uninstall and reinstall gradle (trying both 6.1.1 and 6.5), to remove and add again android platform and I also started a new project but nothing changed.
Update:
android version: 9.0.0 latest build-tools installed (in ANDROID_HOME/build-tools/): 30.0.2
Update (solution): Avast was blocking R.txt creation and editing, I solved my problem by temporarily disabling Avast.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Cordova build android fails after upgrading to ... - Stack Overflow
After upgrading from cordova-android from 9.x to 11.x I get some build errors: FAILURE: Build failed with an exception. * What went wrong: ......
Read more >Android Platform Guide - Apache Cordova
This guide will help set up your development environment for building Cordova apps for Android devices and optionally use Android-specific command-line ...
Read more >Migrating to Cordova-Android 11 - Ionic
All app submissions will be required to target Android 12 (API level... ... If running into the error during building for android:
Read more >Troubleshooting Android Issues | Capacitor Documentation
does not exist". This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX...
Read more >Failed to build android .. any help please - Ionic Forum
failed to build android Platform FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I finally found out what happened: Avast was blocking R.txt creation and editing and of course I received no notification… I solved my problem by temporarily disabling Avast.
I solve it by uninstalling the antivirus.