21:21:57: Executing task 'HelloWorld. The main ()'...
Executing the tasks: [the HelloWorld. The main ()] project in C: \ Users \ Administrator \ AndroidStudioProjects \ Demo2
FAILURE: the Build failed with an exception.
* Where:
Initialization script "C: \ Users \ \ Administrator \ AppData \ Local \ Temp \ HelloWorld_main__ gradle 'line: 20
* What went wrong:
A problem occurred you project ': app'.
Could not create a task ': app: the HelloWorld. The main ()'.
SourceSet with the name 'main' not found.
* Try:
Run with -- stacktrace option to get the stack trace. Run with -- the info or -- debug option to get more the log output. The Run with -- scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle the features were 2 in this build, making it incompatible with Gradle 6.0.
Use '- warning - mode all the to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings
The BUILD FAILED in 308 ms
HelloWorld 21:21:57: Task execution finished '. The main () '.
CodePudding user response:
If you are not registered in the configuration file class?CodePudding user response:
You is a Java project or androidJava prompt you lack of the main method