简体   繁体   English

无法解析符号“ actionBarActivity”-Android

[英]Cannot resolve symbol “actionBarActivity” - Android

A few days ago I updated my android studio and gradle to 4.4.1. 几天前,我将android studio更新了,并将gradle升级到4.4.1。 When I tried to create a class main activity which extends actionbaractivity like this 当我尝试创建一个类的主要活动来扩展actionbaractivity这样的

    public class MainActivity extends ActionBarActivity {

I am getting an error "cannot resolve action bar activity". 我收到一个错误“无法解决操作栏活动”。 I am also getting the error in similar code such as imports and usage of the action bar activity such as 我也收到类似代码中的错误,例如导入和使用操作栏活动,例如

      import android.support.v7.app.ActionBarActivity;

and

    super.onCreate(savedInstanceState);

as well as uses of findViewById. 以及findViewById的用法。

Here is a screen shot for further info, I am using mac os (Sierra) and running the newest version of android studio and jdk. 这是更多信息的屏幕截图,我正在使用mac os(Sierra)并运行最新版本的android studio和jdk。

Here is the error screen/panel: 这是错误屏幕/面板:

https://imgur.com/a/SApx4 https://imgur.com/a/SApx4

and here is the code screen/panel 这是代码屏幕/面板

https://imgur.com/a/45WIi https://imgur.com/a/45WIi

Any help would be greatly appreciated. 任何帮助将不胜感激。

Extend AppCompatActivity instead. 而是扩展AppCompatActivity。

(EDIT: I saw you made a comment about HAX, that's emulator specific. To test your emulator, you would open another AS project and see if it will open in the emulator. It may be possible that HAX isn't supported on your computer.) (编辑:我看到您对特定于仿真器的HAX进行了评论。要测试您的仿真器,您将打开另一个AS项目,并查看它是否将在仿真器中打开。您的计算机可能不支持HAX )

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

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