Reputation: 41
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
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.
Upvotes: 3