简体   繁体   English

Android Studio错误

[英]Android Studio errors

I am new to Android Studio and I am finding it interesting as compared to Eclipse. 我是Android Studio的新手,与Eclipse相比,我发现它很有趣。 When I run an application it runs, but after this and even when starting Android Studio again, it has errors of all classes imported. 当我运行应用程序时,它会运行,但此后甚至再次启动Android Studio时,都会导入所有类的错误。 It says it cannot recognize the objects. 它说它不能识别物体。

as follows: 如下:

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;  //Bundle, Menu and MenuItem are underlined an indication of error

import com.android.volley.*; //volley imports shows correctly


public class MainActivity extends ActionBarActivity {

    RequestQueue queue;
    Request request;

yet when I rebuild the following is the message: 但是,当我重建以下消息时:

Information:Gradle tasks [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library
:app:prepareComAndroidSupportSupportV42211Library
:app:prepareDebugDependencies

You should copy/paste all of the import code into your comment. 您应该将所有导入代码复制/粘贴到您的注释中。 Also, you might want to post your build.gradle file as well (but it sounds like you may just have a syntax error in the imports). 另外,您可能还想发布build.gradle文件(但听起来您导入中可能只是语法错误)。

/sorry to post this as an answer but I don't have the rep to comment /很抱歉,将其发布为答案,但我没有评论代表

Try to clean the project first and 尝试先清理项目,然后

在此处输入图片说明

Sync Project with Gradle Files ;) 与Gradle文件同步项目;)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM