Cannot resolve symbol 'AppCompatActivity' , Cannot resolve symbol 'R', Could not download support-co
Ask Question
up vote 1 down vote favorite
I installed Android Studio 2.1.3, and successfully created a new project (just call it ProA),it runs well in AVD. That time I had just only downloaded the sdk platform android-24 . I created that project with the Minimum SDK API 14. Acutally , I didn't download android-14 that time.
Then latter I downloaded android-14, androdi-15,android-21,android-23, tried to create a new project (call it ProB), but many errors occurred there.
The
MainActivity
's superclass is
AppCompatActivity
, but the error is
Cannot solve symbol 'AppCompatActivity'
.
There is a red line under the
@Override
tag over the
onCreate()
method,saying that
Method does not override method from its superclass
In
onCreate()
method ,the
setContentView(R.layout.activity_main)
code snippet shows
Cannot resolve symbol 'R'
.
The Messages window has a error message saying
A problem occurred configuring project ':app'.
Could not download support-compat.aar(com.android.support:-compat:24.2.0): No cached version available for offline mode
the overall picture is like this: the overall error image(click to see)
// 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:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
the screenshot of the standalone sdk manager (click to see)
modified at 2016 Aug,27
I have downloaded all the Android SDK Build-tools: