Pinaki
Pinaki

Reputation: 41

Android Studio execution error message

A test project is created in Android Studio. Then immediately clicked on run or debug.

The following message pos up:

'Execution failed for task ':app:generateDebugBuildConfig'.
Failed to create D:\Project\Android\Asd\app\build\source\buildConfig\debug\com1\example\app`

One thing I found that Java folder is empty. But in the tutorial a default file is created by the IDE. Unfortunately here it is missing. If more information is needed please post it here. What I am missing, please help me.

***Sorry for the trouble. In response to the message:

Executing tasks: [:app:generateDebugSources]

:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> Failed to create D:\Project\Android\Asd\app\build\source\buildConfig\debug\com1\example\app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.994 secs

Upvotes: 4

Views: 3910

Answers (1)

Ward W
Ward W

Reputation: 669

This appears to be because Windows won't let you name folders COM1, COM2, etc. I had to navigate to app > manifests > AndroidManifest.xml. Then, I edited the AndroidManifest.xml file package value to take out the number after 'com'. So for you, change package=com1... to package=com..., then try re-compiling (Build > Make Project, or CTRL + F9.)

Example of the AndroidManifest.xml file that you need to edit:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourdomain.httpssubdomain.yourappname >

List of forbidden names:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

Source: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Upvotes: 3

Related Questions