Build.gradle启动失败 [英] Build.gradle startup failed

查看:2572
本文介绍了Build.gradle启动失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理我的项目,但笔记本电脑冻结了很长时间。所以,我重新启动并运行Android Studio,但该项目不起作用。所有的活动和类都可以,但Android Studio显示mt build.gradle错误。我的build.gradle(app)文件变空了!这个文件里没有任何东西!我不知道,什么是问题。这里是来自Android Studio的消息

 错误:(1,0)原因:启动失败:
构建文件'C :\ Users \dns\MyApplication\app\build.gradle':1:意外的char:0x0 @第1行,第1列。

这样:

 加载设置
无法从文件加载设置'C:\ Users \\\\\\\\\\\\\\\\\\'':Error line 1:Content is not allowed in prolog。
请更正文件内容

我需要知道什么?也许,我需要找到这些文件?
我没有改变任何东西。



感谢您的帮助!



这是我的gradle file:

 顶级构建文件,您可以在其中添加对所有子项目/模块通用的配置选项。 buildscript {repositories {jcenter()} dependencies {classpath'com.android.tools.build:gradle:1.5.0'//注意:不要在这里放置您的应用程序依赖关系;它们属于//在单个模块build.gradle文件中}} allprojects {repositories {jcenter()}} task clean(type:Delete){delete rootProject.buildDir} 

I was working with my project, but my notebook froze for a long time. So, I rebooted it and ran Android Studio, but the project doesn't work. All the activities and classes are ok, but Android Studio shows mt build.gradle error. And my build.gradle(app) file became empty! There is nothing in this file! I don't know, whats's the problem. Here's the message from Android Studio

Error:(1, 0) Cause: startup failed:
build file 'C:\Users\dns\MyApplication\app\build.gradle': 1: unexpected char: 0x0 @ line 1, column 1.

And this:

Load Settings
        Cannot load settings from file 'C:\Users\dns\MyApplication\.idea\misc.xml': Error on line 1: Content is not allowed in prolog.
        Please correct the file content

What do I need to do know? Maybe, I need to find these files? I did not change anything in them.

Thank you for help!

Here's my gradle file:

Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }

解决方案

In Android Studio "file" menu choose "Invalidate Caches/ Restart"

这篇关于Build.gradle启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆