java – android studio cannot find "Activity" symbol-ThrowExceptions

Exception or error:

I have tried to create and run hello world new app using Android studio.
however i cannot compile as it says it’s cannot resolve Activity symbol.

and also other basic symbols in the black template.

I suggest adding/configuration the JDK.

I guess I’m doing this wrong, because I have tried to add the JDK and the problem re-occurred.

enter image description here

how to solve this?

UPDATE1

couldn’t find external build

enter image description here

enter image description here

Android studio 0.2.6

How to solve:

Android Studio

File -> Invalidate Caches / Restart

It Worked for me.

###

Make sure to import android.app.Activity.

import android.app.Activity;

###

I ran into this problem as well and it was driving me crazy. Here is what worked for me:

I noticed that Under File|Project Structure the Classpath for my selected android SDK (Android 4.3 Google APIs) was blank.

I changed the Build target to a different SDK, then switched back and the Classpath tab became properly populated. Once I did that, android symbols were resolved in my project.

If you don’t see pathtosdk/android-##/android.jar listed in the classpath, this could be your solution.

Leave a Reply

Your email address will not be published. Required fields are marked *