简体   繁体   中英

Cannot resolve symbol “actionBarActivity” - Android

A few days ago I updated my android studio and gradle to 4.4.1. When I tried to create a class main activity which extends actionbaractivity like this

    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.

Here is a screen shot for further info, I am using mac os (Sierra) and running the newest version of android studio and jdk.

Here is the error screen/panel:

https://imgur.com/a/SApx4

and here is the code screen/panel

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

Any help would be greatly appreciated.

Extend AppCompatActivity instead.

(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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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