Non-specific Error in Android studio 3.0 Beta 2 - android

I can't continue building my app, because I updated Android studio to 3.0 beta 2 and I got this error message:
Error:C:\Users\Luk?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.0.1.aar\f61ab9a130e23c5f88348e1bd6936dcf\res\drawable-xhdpi-v4\abc_ic_menu_copy_mtrl_am_alpha.png file not found
Error:C:\Users\Luk?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.0.1.aar\f61ab9a130e23c5f88348e1bd6936dcf\res\drawable-hdpi-v4\abc_btn_radio_to_on_mtrl_000.png file not found
Error:C:\Users\Luk?\.gradle\caches\transforms-1\files-1.1\support-compat-26.0.1.aar\62d1a0a0753b75c4dfbf8fbe3e7715ba\res\drawable-xhdpi-v4\notify_panel_notification_icon_bg.png file not found
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile --legacy -o C:\AndroidApp\app_name\app\build\intermediates\res\merged\debug C:\Users\my_name.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.0.1.aar\f61ab9a130e23c5f88348e1bd6936dcf\res\layout\tooltip.xml
Issues:
- ERROR: C:\Users\my_name.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.0.1.aar\f61ab9a130e23c5f88348e1bd6936dcf\res\layout\tooltip.xml file not found

Try disabling the AAPT2 by adding android.enableAapt2=false to your gradle.properties file.
If you want to build the project with aapt2 enabled the follow the below link for changes in project and to get to how fix the error.
Reference : here
I was using Android studio 3.0.1 In which I disabled the AAPT2 and it resolved my error.

Related

Aapt2 issue with jenkins build Android

I'm using Jenkins to build my android application. I have an issue with Aapt2 when I'm trying to build task "assemble".
I have added the android.enableAapt2 = true but I still have the issue.
Error :
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\9b13819df5a46cfa71ada9be5d91c322\res\layout\abc_search_dropdown_item_icons_2line.xml: error: file not found.
Command: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\bc9c8887a50f76d929803eb5bfe61459\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
D:\jenkins\workspace\DemoProject\app\build\intermediates\res\merged\debug \
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\9b13819df5a46cfa71ada9be5d91c322\res\layout\abc_search_dropdown_item_icons_2line.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #2
Looks like aapt2 is having trouble parsing the file path (it's too long). You can either try upgrading to the newest android gradle plugin which has better support for long paths, or you can try moving your gradle cache closer to the C: root.

Error building android project with gradle using teamcity

Using team city to build and android app. keep getting an error.
[16:59:38] [Step 1/1] Execution failed for task
':app:mergeDebugResources'. org.gradle.internal.UncheckedException:
java.util.concurrent.ExecutionException:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource
compilation failed Output:
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\3467ebf6f9d1bb66db4bdb226db55512\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png:
error: file not found.
Command:
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\8a1ce91548f2547bb27874a553d3981d\aapt2-3.2.1-4818971-windows\aapt2.exe
compile --no-crunch \
--legacy \
-o \
C:\TeamCity\buildAgent\work\7028d0f31da34ed0\Workshop\app\build\intermediates\res\merged\debug
\
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\3467ebf6f9d1bb66db4bdb226db55512\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #1
The file it says it can't find is definitely there. I'm a .net developer with hardly any experience of android development so I have no idea what to look at next in order to fix this. please help.
AAPT2 still seems to have some trouble with long paths on Windows. Try moving your gradle cache closer to C:\ to shorten the file path.
Here's an answer on how to change the cache location: How to set gradle cache location?

Android resource compilation failed when opening a new project in android studio

I have this error when opening new project with my android studio
Android resource compilation failed Output: C:\Projects\Popular2\app\src\main\res\drawable-v24\ic_launcher_foreground.xml:1: error: not well-formed (invalid token).
Command: C:\Users\Personal.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\e2bfab9f446f5b6bef325bd9d21fcd8e\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy -o C:\Projects\Popular2\app\build\intermediates\res\merged\debug
C:\Projects\Popular2\app\src\main\res\drawable-v24\ic_launcher_foreground.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #1
I have tried to clean and rebuild the app but didn't help!
Any help ?
You should :
Go to your project location
delete the drawable-v24 folder.
delete the mipmap-anydpi-v26 if exist.
rebuild your project.

android studio 3.0 | AAPT2 Error: failed to execute apt

when building an app with some videos (mp4) inside raw/ directory i get this error:
raw_frenulectomia.mp4.flat: error: failed to read data meta data.
error: failed parsing overlays.
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
Caused by: java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details
with previous version, everything compiled allright. any idea ?
thanks
Aapt2 is enabled by default when you use android plugin for gradle 3.0.
This is to
improve incremental resource processing
as stated here.
But if you are facing issues with it, you can switch back to previous version by adding this in gradle.properties
android.enableAapt2=false

Android Studio 3.0 migration AAPT2 error

After migrating my existing project to Android Studio 3.0, it is not compiling. Below are the log details:
Error:java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
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:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt
Information:BUILD FAILED in 27s
Information:11 errors
Information:0 warnings
Go to your gradle.properties write the below code and Sync your project
android.enableAapt2=false
Is your username in OS cyrillic? If so - you need to change the .gradle resource folder in settings to path which does not contain cyrillic symbols.
In ->Settings-> Build, Execution -> Gradle change Service directory path to "C:/Users/Public/.gradle"
this problem occur when there is something wrong in your XMl file
1:- remove all unnecessary XML files from your code
2:- Reopen and Check XML files
If there is Still Problem
Go to your gradle.properties write the below code
android.enableAapt2=false
and then Go to your build.gradle(app) write the below code and Sync your project
aaptOptions {
cruncherEnabled = false
}
Note android.enableAapt2=false is deprecated, and will be removed by the end of 2018, so this doesn't solve the problem, is just a temporary workaround

Categories

Resources