Android Studio: Error:Execution failed for task

Viewed 2320

This is a new installation for Android studio 2.3.3 on windows 10 64bit machine, android failed execution for first project, never worked, I tried all solutions here, delete cache, rebuild, clear project, reinstall Android, reinstall Java, environment variables, not using embedded JDK, changing project path what ever solution never worked with this error:

Error:Execution failed for task ':app:processDebugManifest'.

com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: C:\Users\myAccount.android\build-cache\6460e35c08ce39c08eb2823bfce76d67a31dcb77\output\AndroidManifest.xml (The system cannot find the file specified)

Gradle Module

Gradle Module

Gradle Project

Gradle Project

6 Answers

Try below code in build.gradle file and rebuild project again;

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.user.packagename"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 25
    versionName "2.5"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/NOTICE' // will not include NOTICE file
    exclude 'META-INF/LICENSE' // will not include LICENSE file
    exclude 'META-INF/DEPENDENCIES' // will not include LICENSE file
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}

Thank you guys, you helped me alot solve this issue Here is what happened, i traced that error , Android studio cannot find the file AndroidManifest.xml in the cash output folder, and actually it wasn't there, next step i deleted everything in the folder: C:\Users\myAccount.android\build-cache, and gave permission to the .Android folder, and deleted all old projects, cearte new project and the AndroidManifest.xml is there, now im checking my app on my Samsung device, i revert all modification to default settings for Android Studio, and it is still fine , what i think is the deleting all file in cash solved the issue, i already did it before but may be it is multiple problem like missing SDK that i have installed ... thank you all hopefully somebody benefit from this

Moving project files to ntfs drive fixed it.

Strangely enough, also moving my files from an exFAT drive to an NTFS one seemed to work

you need to check for your minSDK if its not installed then you need to first installed the proper SDKs,and then everything worked fine.hope it will work for you.

Related