AppCompatActivity not playing nice!

#1

Working thrrough the 1st app, with a class starting out in part like this:


package com.bignerdranch.android.geoquiz;

      >   import android.app.Activity;
        import android.os.Bundle;
        import android.support.v7.app.AppCompatActivity;
        import android.view.Menu;
        import android.view.MenuItem;
        import android.view.View;
        import android.widget.Button;
        import android.widget.Toast;
public class QuizActivity extends AppCompatActivity {

Android Studio “cannot find declaration to go to” on import line of AppCompatActivity AND AppCompatActivity “cannot be resolved” as extends AppCompatActivity.

Under File-- Project Structure I have > Android SDK Location set to the android studio sdk >JDK location to jdk1.8.0_101

In my computer sys environment vars I have PATH, CLASSPATH and JAVA_Home set.

My build.gradle file(app )is:


apply plugin: ‘com.android.application’

android {
compileSdkVersion 20
buildToolsVersion “20.0.0”

defaultConfig {
    applicationId "com.bignerdranch.android.geoquiz"
    minSdkVersion 16
    targetSdkVersion 20
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
compile fileTree(dir: ‘libs’, include: [’*.jar’])
}


my build.gradle(GeoQuiz) is :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:0.13.2’

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
}
}


I have googled this problem and looked on this forum. One suggestion was to ignore the problem by extending Activity not AppCompatActivity and get back to the problem later in later chapters.

But I would like to resolve the issue now, so that I have confidence the system is working as it needs to be for the remaining of the book. Also its not best way to start off when trying to learn and you have a barrier knocking your confidence at the first hurdle.

Also some answers online were “over my head” so any step-through process for the resolution would be awesome!