Failed to compile values file. ERROR : app:mergeDebugResources FAILED - android-studio

I try to run my program but I have a Build: failed
Failed to compile values file
I don't know why but the sentence is showing me
Task :app:mergeDebugResources FAILED
and I have this error
Execution failed for task ':app:mergeDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Resource compilation failed. Check logs for details.
and the explanation
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
Does anyone have a solution?
Please?

The error suggests something related to any values file entry you have.
For example : when adding a string entry value many times the char ' is present without the proper escape char \
<string name="_title">Today's</string>
needs to be corrected to:
<string name="_title">Today\'s</string>

Related

Try adding the name of the type of the variable or the keyword var addPostFrameCallback

/C:/development/flutter/packages/flutter/lib/src/widgets/binding.dart:271:3: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
addPostFrameCallback
^^^^^^^^^^^^^^^^^^^^
/C:/development/flutter/packages/flutter/lib/src/widgets/binding.dart:271:3: Error: Expected ';' after this.
addPostFrameCallback
^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\development\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\development\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 1m 18s
Exception: Gradle task assembleDebug failed with exit code 1

node build adding x86_64 and failing on M1 chip?

I am trying to build an application but it fails when setting up the node.
> Task :my-app:nodeSetup FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':my-app:nodeSetup'.
> Could not resolve all files for configuration ':my-app:detachedConfiguration22'.
> Could not find node-16.4.0-darwin-x86_64.tar.gz (org.nodejs:node:16.4.0).
Searched in the following locations:
https://nodejs.org/dist/v16.4.0/node-v16.4.0-darwin-x86_64.tar.gz
it looks like its adding x86_64 to the end of the artifact? and because of that its not finding it in the repository. Any ideas? Please let em know if you need more info.

FAILURE: Build failed with an exception error when I run the app

I started working with a flutter project, and as a beginner, I tried to run the default code given by the flutter team. But I keep getting the error as given below.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform artifact 'core.aar (androidx.core:core:1.1.0)' to match attributes {artifactType=android-res}.
> Execution failed for AarTransform: C:\Users\krish.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0.
> Cannot parse result path string:
Failed to transform artifact 'core.aar (androidx.core:core:1.1.0)' to match attributes {artifactType=android-res}.
> Execution failed for AarTransform: C:\Users\krish.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0.
> Cannot parse result path string:
Failed to transform artifact 'core.aar (androidx.core:core:1.1.0)' to match attributes {artifactType=android-res}.
> Execution failed for AarTransform: C:\Users\krish.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0.
> Cannot parse result path string:
Failed to transform artifact 'core.aar (androidx.core:core:1.1.0)' to match attributes {artifactType=android-res}.
> Execution failed for AarTransform: C:\Users\krish.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0.
> Cannot parse result path string:
Failed to transform artifact 'core.aar (androidx.core:core:1.1.0)' to match attributes {artifactType=android-res}.
> Execution failed for AarTransform: C:\Users\krish.gradle\caches\transforms-2\files-2.1\a528b13ac93e64cafa3d0480e2c93207\core-1.1.0.
> Cannot parse result path string:
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 7s Exception: Gradle task assembleDebug failed with
exit code 1
It would be of great help if you could help me out. Thanks in advance.

Error: Debug Failure. Output generation failed when running formatjs extract

When running formatjs extract this is what we got. From the stack trace it seems that the issue is from formatjs themselves. Feel like I am stuck on what the issue is here.
$ formatjs extract './src/**/*.{js,ts,tsx}' --out-file './src/i18n/messages/messages.json' --extract-from-format-message-call --throws
Error: Debug Failure. Output generation failed
at Object.transpileModule (/Users/.../node_modules/#formatjs/cli/node_modules/typescript/lib/typescript.js:126894:29)
at processFile (/Users/.../node_modules/#formatjs/cli/src/extract.js:104:39)
at /Users/.../node_modules/#formatjs/cli/src/extract.js:163:59
at step (/Users/.../node_modules/#formatjs/cli/src/extract.js:44:23)
at Object.next (/Users/.../node_modules/#formatjs/cli/src/extract.js:25:53)
at fulfilled (/Users/.../node_modules/#formatjs/cli/src/extract.js:16:58)
error Command failed with exit code 1.
You might be processing a file that needs to be ignored using --ignore. Can you upgrade to the latest version and re-run your command? Long added the filename in this commit https://github.com/formatjs/formatjs/commit/ceb0bf8a58c13fe6811bc35191018ee1c431484a
Reference: https://github.com/formatjs/formatjs/issues/2044

Android Studio: Error after deleting file

I got this error:
Error:Execution failed for task ':app:generateDebugBuildConfig'. > java.io.IOException: Could not delete path 'C:\Users\Guest Account\Documents\COLLEGE\FYP\7. Iteration 4\fridge iteration 4\app\build\generated\source\buildConfig\debug\com'.
and saw 'could not delete path' so I decided to follow the path and delete the path. When I reran the app I got seven new errors:
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:failed linking file resources.
Error:attribute 'com.virtual.fridge:layout_behavior' not found.
Error:error: attribute 'com.virtual.fridge:layout_behavior' not found.
In my even log I have two new messages:
* daemon not running; starting now at tcp:5037
21:10 * daemon started successfully
I am going to presume this is down to deleting that file.. is there anything I can do? Really new to android studio so I appreciate any help. Please tell me what other information I shoudl provide
I cleaned the project and built it and it worked

Resources