Jump to content

Android studio error when emulating !directory.isDirectory()

NystriX

Hey, I was working on an app on other pc however now I no longer have access to that machine... When downloading Android studio on my machine there were no errors at first glance(I've been Alt+Entering 70% of the project which was a real pain...), but when trying to emulate(to a virtual machine nor actual smartphone) I've been getting this error-

!directory.isDirectory()

Send help

HSvWYFB.png

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

It's hard to say what the problem could be without knowing what the app is supposed to do or seeing the code. Can you post the lines of code that are producing that error?

 

Does it work on a real phone?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, Sauron said:

It's hard to say what the problem could be without knowing what the app is supposed to do or seeing the code. Can you post the lines of code that are producing that error?

 

Does it work on a real phone?

It's a build error, as in the project doesn't even compile so it's not a bug in the code as such ;)

 

@OP: It sounds like you're not using any form of version control system (e.g. Git) and manually copied the project files? I guess you're now missing some settings. Maybe this will help: https://stackoverflow.com/questions/54519085/unknown-error-in-android-studio-directory-isdirectory-in-apppackagedebug

 

~edit: This is not related to Android Studio or the emulator either. For some reason the compiler (Gradle) can't build your project, so something about your setup is broken. Try compiling from the command line with the debug flag, maybe you see something that gives you an idea why it is failing (e.g. "gradlew.bat --debug")

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Eigenvektor said:

It's a build error, as in the project doesn't even compile so it's not a bug in the code as such ;)

Oh that's right, OP said he got this on the emulator so I assumed it was a runtime error.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Sauron said:

Oh that's right, OP said he got this on the emulator so I assumed it was a runtime error.

Yeah, the description is a bit misleading :D The screenshot shows a "build failed" so it doesn't even build for some reason. OP says they had to Alt+Enter a lot after copying the project from another PC which sounds like their imports were missing. Makes me suspect individual code was copied, not the project as a whole. Since it fails with "!directory.isDirectory()" it sounds like it may be missing some directory that Gradle expects to be there.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

56 minutes ago, Sauron said:

Oh that's right, OP said he got this on the emulator so I assumed it was a runtime error.

 

51 minutes ago, Eigenvektor said:

Yeah, the description is a bit misleading :D The screenshot shows a "build failed" so it doesn't even build for some reason. OP says they had to Alt+Enter a lot after copying the project from another PC which sounds like their imports were missing. Makes me suspect individual code was copied, not the project as a whole. Since it fails with "!directory.isDirectory()" it sounds like it may be missing some directory that Gradle expects to be there.

The project was copied as one whole project over a USB Drive, however I forget to mention that the Android studio version on the previous machine was outdated and on the current machine it is updated. May it has something to do with that?

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

didnt read other suggestions but my guesses would be:

1) android studio cant access the build path because of insufficent permissions

 

2) and some programms have problems with directorys have spaces in them [dont think android studio is one of them but i dont know for sure]

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, NystriX said:

 

The project was copied as one whole project over a USB Drive, however I forget to mention that the Android studio version on the previous machine was outdated and on the current machine it is updated. May it has something to do with that?

Quite possible. The project may be using outdated configuration that no longer works on the latest version of Android Studio/Gradle.

 

Try to check if the permissions are set correctly, as @KNG_HOLDY said. I've also had issues where a previously empty directory was missing (e.g. "res") and that was causing build issues. If you have a project that works, try to see if any src, res or build directories are missing.

 

Alternatively, you could try to create a new empty project in Android Studio, see if that builds. If that's the case you could try to port the code into the new project. It'll be a pain but might be easier than trying to figure out what is broken in the old code. Ideally don't port everything all at once and use something like Git to keep track of changes. If the project breaks again you'll have an easier time figuring out the cause if the changes between "works" and "stopped working" aren't too many.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, KNG_HOLDY said:

1) android studio cant access the build path because of insufficent permissions

well.. in my pc u have to type a PIN to give permissions for softwares to do sh1t(like you can't just click yes and that's all),  could it be that this was had something to do with that the problem?

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, KNG_HOLDY said:

1) android studio cant access the build path because of insufficent permissions

well.. in my pc u have to type a PIN to give permissions for softwares to do sh1t(like you can't just click yes and that's all),  could it be that this was had something to do with that the problem?

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, NystriX said:

well.. in my pc u have to type a PIN to give permissions for softwares to do sh1t(like you can't just click yes and that's all),  could it be that this was had something to do with that the problem?

yes that could be the case 

just do what @Eigenvektor suggested, create an empty project and test if you can build it - thats would be my next step in debugging that problem aswell

 

if that works then your project files are broken

if that doesnt work and you choose the same drive (e.g. C:\) for both projects it could be an permissions problem

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, KNG_HOLDY said:

yes that could be the case 

just do what @Eigenvektor suggested, create an empty project and test if you can build it - thats would be my next step in debugging that problem aswell

 

if that works then your project files are broken

if that doesnt work and you choose the same drive (e.g. C:\) for both projects it could be an permissions problem

 

11 minutes ago, Eigenvektor said:

Quite possible. The project may be using outdated configuration that no longer works on the latest version of Android Studio/Gradle.

 

Try to check if the permissions are set correctly, as @KNG_HOLDY said. I've also had issues where a previously empty directory was missing (e.g. "res") and that was causing build issues. If you have a project that works, try to see if any src, res or build directories are missing.

 

Alternatively, you could try to create a new empty project in Android Studio, see if that builds. If that's the case you could try to port the code into the new project. It'll be a pain but might be easier than trying to figure out what is broken in the old code. Ideally don't port everything all at once and use something like Git to keep track of changes. If the project breaks again you'll have an easier time figuring out the cause if the changes between "works" and "stopped working" aren't too many.

the project is located in side the default document Windows folder which is inside Users folder and I'm pretty sure you need a permission for that folder I have tried to move it to another Drive now it shows this

studio64_IVSGIK6Pe8.png.b3edee1df81fe9be221655b8035710d5.png

and Android Studio suggeste me to download some Gradle plugin sooo im doing it rn, hoping it will do somthing...

studio64_fesaJF2bbb.png.c58e48fc5f6178aabc7ffa8203e0eb68.png

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

its downloading your project's dependencies now

 

looks good so far

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, NystriX said:

 

the project is located in side the default document Windows folder which is inside Users folder and I'm pretty sure you need a permission for that folder I have tried to move it to another Drive now it shows this

studio64_IVSGIK6Pe8.png.b3edee1df81fe9be221655b8035710d5.png

and Android Studio suggeste me to download some Gradle plugin sooo im doing it rn, hoping it will do somthing...

studio64_fesaJF2bbb.png.c58e48fc5f6178aabc7ffa8203e0eb68.png

 

The download part is fine. Gradle is a build system that includes dependency management so it'll download whatever dependencies are specified in your build.gradle. If it says Gradle sync failed there should be a more detailed error in the build logs. Gradle sync usually fails if something about your Gradle files is incorrect.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/6/2020 at 2:39 AM, Sauron said:

Oh that's right, OP said he got this on the emulator so I assumed it was a runtime error.

 

On 3/6/2020 at 4:12 AM, KNG_HOLDY said:

its downloading your project's dependencies now

 

looks good so far

 

On 3/6/2020 at 4:14 AM, Eigenvektor said:

 

The download part is fine. Gradle is a build system that includes dependency management so it'll download whatever dependencies are specified in your build.gradle. If it says Gradle sync failed there should be a more detailed error in the build logs. Gradle sync usually fails if something about your Gradle files is incorrect.

I cant fakin belive it, it was my antivirus ffs...

Very uncool McAfee...

PS2 Fat(JP) : PS2 S Silver(EU) : PS3 Super Slim : Nintendo Switch
Wii(x2) : SNES CE : Xbox One : Xbox 360 S(EU) : PS Vita 2000
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×