Error:java.util.concurrent.ExecutionException - android

I have been working on this app for a while and a couple of days ago i came across this error message when I try to build the project:
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\USER_NAME\AppData\Local\Android\Sdk\build-tools\26.0.3\aapt.exe.
Also everytime I use R. (for example R.Drawable) it says cannot resolve symbol R.
I already tried to change the buildToolsVersion to the most recent version, added android.enableAapt2=true to the gradle.properties, cleaning and rebuilding the project but nothing seems to help.
I´ve been trying to solve this problem for a while, I've found a lot of similar questions on StackOverflow, but don't seem to be able to fix it despite of the several attempts to do it. If someone were to help me would very much appreciatted.

Related

I keep getting execution failure today with :app:compileDebugKotlin even though I have no errors in my code?

I am a beginner studying, so be certain the apps I am working on are not overly complicated, just basic experimenting apps.
I keep getting the same error today across different apps I am working on:
Execution failed for task ':app:compileDebugKotlin'.
I definitely had a update for kotlin in studio today. Could it be an issue with the update? Is anyone else experiencing the same? I have no idea how to fix it.
Android doesn't mark any errors in my code, and I've made sure that the dependencies in the build.gradle are the latest version (not sure if that would've been an issue but it was highlighted as an issue so I've synced it).
RESOLVED: beginners mistake I have missed an indication in the build log to where my mistake was.
I had unresolved references in my code to a fragment that was deleted.

Could Not parse Array item

I was working on my android studio when this error appeared in I think gradle-values files.
here is what messages say
/home/aayush/.gradle/caches/transforms-1/files-1.1/play-services-
cast-framework-
11.8.0.aar/32e84c2c10bff7a8fd7f6321ccbff502/res/values/values.xml
Error:(5, 1) error: could not parse array item.
Error:java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details
I tried deleting the whole build folder,.gradle folder, cleaning and rebuilding folder, invalidating caches and restarting android studio but, this error comes again and again. I am using android studio 3.1, the latest one. please help. If you need any other detail, just tell me. i am facing this problem for the first time, so, dont know what to post.
I was facing that issue too.
That may be invoked in several reasons.
In my case, I got the error because of the 'strings.xml' file has like this components
<string name="today_string">'today'</string>
this mistakes made this error, and I converted 'today' to \'today\'
And it solved my issue. Refer.

Build error resource directory not found

I'v created a new android project in vs 2013 and installed Android.Support.Library.v7.AppCompat package and dependencies. But when I build the project, I got an error that says
resource directory
'[ProjectPath]\obj\Debug\resourcecache\B81A750477D10031D1844681B0F7EB17\res'
does not exist file: [ProjectPath]\AAPT
I'v cleaned the project
reopen it
rebuild it
but not help me.
I have encountered the same issue as you and have found a solution. I know this has been a long time since your post. Just put the solution here to help someone encounter similar issues.
My project can be built successfully previously, so this error must be caused by some kind of settings. A reasonable explanation and solution can be found in this link: http://smstuebe.de/2016/10/29/fix-android-app-compat/
This is caused by the incomplete Android SDK packages. The normal clean/rebuild won't help. Even if I reinstalled VS2015+Xamarin, I still have this issue.
So try the above solution if you came across similar issues.

OpenCV with Android Studio Problems

I know this has been discussed before, but I have had frustrating 3 days and I still can't get it to work. I am following this
After I finish 'Adding OpenCV to your new project', I get the error:
'Gradle 'opencvtest' project refresh failed' with a blank after Error
I tried everything, but even the simplest things don't work anymore. Can anyone help me?
Check out this repository: https://github.com/gowithfloat/android-opencv-template just download and should work.

Android studio How to resolve Error in png files of library added

I have no Idea what is happening, last time when I finished my app I build its release apk and all was working just fine as expected but now today when I tried to make that pproject again and to make another apk I am getting the following error.
Error:Execution failed for task ':app:mergeDebugResources'.
Crunching Cruncher common_signin_btn_icon_pressed_light.9.png failed, see logs
I have no idea how to resolve it I have serached and found restarting Android studio and clean the project would remove it , doing this many times has no effect on this error. I have even restarted my machine but the condition of error in same.
In the logs I have seen that this png file is from the library I added , so just for testing I removed that library and tried to build then it started to give me same error with different png file name in other library. So how to fix this issue ?
My Questions are :
How can this issue be Solved ?
Have some one faced this problem too ?
Is this problem has been reported to google ?
Why in android we do not have any stable platform for development as IOS have ?
Try to remove "builds" folders and do rebuild. But soon, the whole thing in a long file name. Read this answer. By the way, you looked logs? Maybe this is not the PNG? You have not sent the log and did not specify the version Gradle.
Believe me, iOS developers have own problems.

Categories

Resources