android studio cannot find the file specified

2020-08-16 17:13发布

问题:

Whenever I try to run my android application, I receive an error message in the run message log.

I/O Error: D:\Apps\Application\app\build\intermediates\classes\debug\app.apk (The system cannot find the file specified)

I don't believe this is a coding error because android studio is not telling me that there are errors within my java classes or xml layouts, but if you do want code, please comment so. I think the error is in the gradle dependencies. Can anyone explain how to solve this issue?

Gradle dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:7.0.0'
}

Note: I have googled this error, but the only one who has also had this issue is this person (android studio cant build) but the answer doesn't apply to me.

回答1:

Try to close project, remove folder classes on path D:\Apps\Application\app\build\intermediates\classes\, reopen project and rebuild. When I had same issue, it helped me.