Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Error: Path is not a readable directory for an Android Project saved in OneDrive

I tried to use a OneDrive folder to store my Flutter project [Windows 10, Android Studio]. I then made edits to it on another machine [same configurations]. The project compiled fine on the first machine initially and on the second one after the changes. Running it on the first machine again after the changes I get the below error:

Execution failed for task ':app:processDebugResources'. 

Path "build/[package]/intermediaries/compiled_local_resources" is not a readable directory.

I've tried a number of solutions mentioned in similar, though not equivalent issues:

  1. Updating Android Studio
  2. Running Android Studio as Administrator
  3. Removing the [package] from my dependencies (this resulted in a different package being identified in the error message).

  4. Pressing File -> Invalidate Caches / Restart...

  5. Commenting out "org.gradle.jvmargs=-Xmx1536M" in gradle.properties

  6. Doing:
cd android 
gradlew clean

None of this worked.

like image 634
Pjotr Gainullin Avatar asked Mar 02 '20 06:03

Pjotr Gainullin


5 Answers

I had the same problem today:

Path "build/[package]/intermediaries/compiled_local_resources/debug/out" is not a readable directory.

I was able to fix this issue by deleting the .gradle and rebuilding the project.

like image 160
Vadow Avatar answered Oct 17 '22 23:10

Vadow


I had the same issue, came out of no where and it really shouldn't make the build fail... but all I did was create the (empty) directory that it was looking for and it built fine afterwards.

like image 24
buradd Avatar answered Oct 17 '22 23:10

buradd


I know the OP had Windows, but if it helps anyone else in the future:

On Mac OS I discovered (the hard way) that Android Studio and Flutter do not play nice with being stored in iCloud! I noticed that some files weren't available locally and that's what was causing the problem for me. I moved my project out of iCloud (forcing it to download the missing files forever) and then it was fine.

like image 2
KidIcarus271 Avatar answered Oct 18 '22 00:10

KidIcarus271


All I did was create the (empty) directory that it was looking for and it built fine afterward.

mkdir -p compiled_local_resources/debug/out
like image 5
HimalayanCoder Avatar answered Oct 18 '22 00:10

HimalayanCoder


In the end the only thing that worked for me was pushing the project up to a Git remote and cloning it from there into another (local) directory.

[not sure this counts as a solution but nothing else worked for me after a long agonising search so hopefully it helps someone]

like image 2
Pjotr Gainullin Avatar answered Oct 17 '22 23:10

Pjotr Gainullin