简体   繁体   中英

Android Studio Cannot Build gradle

I have got problem when build to Android Studio.
The errors are as follow:

> C:\Users\Mehmet Ali
> ?EKER\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5c56da03fce8983be0f1e4db139281b1\res\drawable-xxxhdpi-v4\abc_text_select_handle_right_mtrl_light.png:
> error: file not found.
> 
> C:\Users\Mehmet Ali
> ?EKER\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5c56da03fce8983be0f1e4db139281b1\res\drawable-xxhdpi-v4\abc_btn_radio_to_on_mtrl_015.png:
> error: file not found.
> 
> C:\Users\Mehmet Ali
> ?EKER\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5c56da03fce8983be0f1e4db139281b1\res\drawable-xxhdpi-v4\abc_btn_radio_to_on_mtrl_000.png:

> error: file not found.

try the following solutions:

1- try to invalidate cache: how? File -> Invalidate Caches /Restart

2-Try to change service directory path to something without cyrillic symbols, like "C:/gradle" in

Settings > Build, Execution, Deployment > Gradle

And don't forget to invalidate caches after that.

Make sure you have those image files in the drwaable folders or remove the reference of those images from your java code.

After that try to invalidate the cache.

Let's revisit tamtom's answer. Because android studio is not recognizing the directory for non-English characters, you need to move your directory to a different one that only has English characters.

C:/.gradle

sample screenshot of where you need to make the changes: https://cdn-images-1.medium.com/max/1600/1*PhYaqDbqXDRBO0-rILqLeg.png

edit: I want to comment instead of answer but I need 50 reputation..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM