Your Project Path Contains Non-Ascii Characters Android Studio

Your SDK location contains non-ASCII characters - no Android in Tools Menu

As a matter of fact at the moment there is no other way than to re-install Android Studio to some other directory with no non-ASCII characters and blank spaces, like С:\Android\SDK

Fix AAPT2 ERROR in Android Studio with non-ASCII characters in Windows user name

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.

How to fix? Android Studio file path Error

You need to change the path of your SDK, it cannot be inside your Users/kullan... folder because of the non-ASCII characters in your User's name.

Here's a table of all the accepted ASCII characters

How to filter a Java Collection (based on predicate)?

Java 8 (2014) solves this problem using streams and lambdas in one line of code:

List<Person> beerDrinkers = persons.stream()
.filter(p -> p.getAge() > 16).collect(Collectors.toList());

Here's a tutorial.

Use Collection#removeIf to modify the collection in place. (Notice: In this case, the predicate will remove objects who satisfy the predicate):

persons.removeIf(p -> p.getAge() <= 16);

lambdaj allows filtering collections without writing loops or inner classes:

List<Person> beerDrinkers = select(persons, having(on(Person.class).getAge(),
greaterThan(16)));

Can you imagine something more readable?

Disclaimer: I am a contributor on lambdaj



Related Topics



Leave a reply



Submit