FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.2-6040484-windows Daemon #12: Compile 'C:\Users\Abh\AndroidStudioProjects\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-th\values-th.xml' timed out, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
AAPT2 aapt2-3.6.2-6040484-windows Daemon #9: Compile 'C:\Users\Abh\AndroidStudioProjects\MyApplication\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-en-rAU\values-en-rAU.xml' timed out, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
This is the issue, I keep getting whenever I try to run flutter.
Could anyone provide a solution to this...please?
Without seeing the whole picture it is really hard to say, though, according to official documentation About AAPT issue seems to be related to your resource bundle. Check if you are using everything correct links to your resources. I believe issue have occurred in your .xml files values-th and values-en-rAU. It is a good idea if there are some strings marked as translatable check if there are corresponding values in those file
Related
I am trying to work with Jenkins however I cannot build the apk with it as I am having issue with AAPT2 and Gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-hdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-xhdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-mdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
I already read tons of SO question that may share same issue to my case saying that it has something to do with the file path being too long but I still cannot find any solution.
UPDATE
I tried to change Android Studio Gradle home similar to what Jenkins is using and received similar error which indicates that it may really have something to do with long file path.
I think the final question will be how to change Jenkins Gradle Home?
You need to replace \ with \\ if you are giving path with jenkins in Windows.
May be if file path is too huge or that is the root cause you can try mounting the directory to a short path
EDIT : Based on your modified question :
Open Jenkins dashboard. Navigate to Manage Jenkins-> Configure System. Under the Global properties section add another environment variable named GRADLE_USER_HOME as shown below.
I ran into this exact issue, but unfortunately changing the GRADLE_USER_HOME environment variable did not help, as aapt2 appeared to ignore the change and still used Windows/system32/... for the cache location.
The problem was how I was running Jenkins as a service. In the service.msc settings, it was set to Log On as a Local System account, which set the USER_HOME variables to C:\Windows\System32. Because of this, the reason the error said that the file did not exist was because Jenkins/gradle did not have access to the System32 folder.
My fix was to change the log on method to 'This account', then enter a user account so Jenkins wasn't logged on as system anymore.
Working on the react-native app with go-Lang, In the sentry plugin facing issue while generating the release APK file. But we can able generate debug APK through android studio.
Android studio error messages:
sentry reported an error: You do not have permission to perform this action. (http status: 403)
Process 'command 'node_modules/#sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
Task :app:bundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED
Skipping task ':app:bundleReleaseJsAndAssets_SentryUploadCleanUp' as task onlyIf is false.
:app:bundleReleaseJsAndAssets_SentryUploadCleanUp (Thread[Execution worker for ':' Thread 8,5,main]) completed. Took 0.0 secs.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
java.lang.NullPointerException (no error message)
I tried blow steps are tired
Followed https://docs.sentry.io/platforms/react-native/advanced-setup/
I removed the line cli.executable=node_modules/#sentry/cli/bin/sentry-cli in android/sentry.properties
Modified logLevel: "debug/release"
Verified with enableHermes true/false
Which is source stoping us, any guidelines will help to proceed further.
Please be aware to the name of the project in your sentry.io site.
I changed my project name from "react-native" to "my-project", and i got this error.
so I went to this path:
android/sentry.properties
and i changed the line 3
defaults.project=react-native
to this:
defaults.project=my-project
and the error is gone!
I am sure it will help.
Recently I noticed that errors from data binding are not descriptive at all. Does anybody know how to find real error message instead of "follow-up" error message?
For example I'm getting errors like this:
...\build\generated\source\kapt\debug\com\company\example\DataBinderMapperImpl.java:18: error: cannot find symbol
import com.company.example.databinding.FragmentApplicationDetailsBindingImpl;
^
symbol: class FragmentApplicationDetailsBindingImpl
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
Only information I got from this is that error is in FragmentApplicationDetailsBinding or in fragment_application_details.xml layout file respectively.
Error caused the binding file to fail to generate so it's missing obviously. But no information what exactly went wrong during generation of FragmentApplicationDetailsBinding. :(
Try to clean and rebuild the project if its not work go to File->Invalidate caches / restart.
"Cause: invalid code lengths set" error. The run tasks ended at App:packageDebug. From the long list of things, three under compiler are more informative I guess:
org.gradle.tooling.BuildException: invalid code lengths set
java.util.zip.ZipException: invalid code lengths set
java.lang.IllegalStateException: Still waiting to inspect output APK's res/raw/shape_predictor_68_face_landmarks.dat
On the right side there was: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:packageDebug'.
I searched all over the places and tried everything I could find, but it did not work. Also, I cleaned the cache and restarted, I tried different emulator and devices. I also tried different project settings and structure settings. I also noticed that a very similar post was not answered: build failed because of "org.gradle.tooling.BuildException: invalid code lengths set"
I am try to build android apps but while creating apps my build failed with following errors.
D:\ibm\AnywhereWorkManager\build.xml:87: The following error occurred
while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:720: The
following error occurred while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:716: Failed
building application:
com.worklight.builder.exception.WorklightBuildException:
java.io.IOException: Unable to delete directory
D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo.
at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
I know this answer might seem obvious, but if you have any of the files mentioned in the failure (D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo)
open ( commandline, eclipse, other editor), this will cause the issue.