首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >第一次在IntelliJ -问候单词错误

第一次在IntelliJ -问候单词错误
EN

Stack Overflow用户
提问于 2013-09-20 17:48:06
回答 1查看 2.4K关注 0票数 2

我刚刚做了一个安卓的Hello Word应用。但是,我得到了这样的错误:

代码语言:javascript
复制
Error(3, 19) package android.app does not exist

Error(4, 18) package android.os does not exist

Error(6, 33) cannot find symbol
symbol: class Activity

Error(11, 26)cannot find symbol
symbol: class Bundle

Error(12, 9)cannot find symbol
symbol  : variable super

Error(13, 9)cannot find symbol
symbol  : method setContentView(int)

Error(10, 5)method does not override or implement a method from a supertype.

当我双击error时,im会得到如下信息:

代码语言:javascript
复制
package com.example.Hello;

import android.app.Activity;
import android.os.Bundle;

public class MyActivity extends Activity {
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
EN

回答 1

Stack Overflow用户

发布于 2014-07-10 15:20:18

我也有同样的问题。添加SDK时,I can fixed it from this thread,有时intelliJ缺少路径/文件

  1. 选择你的安卓项目
  2. 按ctrl +alt + shift +S
  3. 从项目的类路径选项卡下选择SDK
  4. 在类路径选项卡下必须有android.jar,res,annotations.jar可能在步骤5中遗漏了一个或几个文件。然后,
  5. 转到android SDK home path字段并再次添加你的SDK文件夹文件,即使你有所有的jars,但仍然得到错误。然后从类路径中删除所有jars并重新添加它们(如步骤6所示)。
  6. Build菜单-Rebuild您的项目。
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18913666

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档