Skip to content Skip to sidebar Skip to footer

Fix Aapt2 Error In Android Studio With Non-ascii Characters In Windows User Name

I installed the latest Android Studio and started to play around it. I created a new navigationbar project and put a gridview into it. Then when I try to build and run it I get thi

Solution 1:

The problem in this case was that I have non-ASCII characters in my Windows user name and thus in my user folder and gradle was set to use a folder under this user folder. You can change your visible user name in Windows, but you can not change your user name from your user folder without reinstalling.

Luckily you can change the folder gradle is using from Android Studio settings.

First make a .gradle folder somewhere in your file system where you don't have those non-ASCII characters. (I chose to use C:\android-sdk\.gradle)

Open File -> Settings -> Gradle

and there you can choose the "Service directory path" that Gradle is using. Change this to the folder you created and this problem should be solved.


NOTE! I've faced this same problem when building react-native android apps too, so if you came here, because you got this same AAPT2 error with RN as well, try to change the gradle folder from you RN project's gradle files. At the moment I don't know how to do that and that's another question and topic too.

Post a Comment for "Fix Aapt2 Error In Android Studio With Non-ascii Characters In Windows User Name"