在android studio上创建我的第一个HelloWorld应用程序时遇到问题

时间:2019-03-01 22:05:15

标签: java android gradle

这些是我收到的错误;

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\AndyKhayaMhlanga\.gradle\daemon\helloWorld3\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Could not create plugin of type 'AppPlugin'.
      > com/android/ide/common/blame/MessageReceiver

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

* Get more help at https://help.gradle.org

CONFIGURE FAILED in 9s
ERROR: Unable to load class 'com.android.ide.common.blame.MessageReceiver'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

2 个答案:

答案 0 :(得分:1)

您可以尝试某些建议。我将从重新同步Gradle开始:在Android Studio中,执行File -> Sync Project with Gradle Files

这将确保下载所有依赖项。

答案 1 :(得分:0)

我确实相信,当您启动新的应用程序时,Android Studio会自动在中心显示TextView,并显示“ Hello,World”。我这你想完成什么? 如果不是这样,这在我之前发生过,也许回到第一个版本或重新开始会有所帮助。如果您首先从头开始,请先进行布局,然后再编写代码段。当它不起作用时,您会知道出了什么问题。 希望这会有所帮助!