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.

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 issue

I 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:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
fabrizio03commented, Dec 17, 2020

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.

2reactions
ZAHHAR-ISMAILcommented, Feb 6, 2021

I solve it by uninstalling the antivirus.

Read more comments on GitHub >

github_iconTop 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 >

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