无法识别AppcompatActivity

时间:2015-12-08 12:44:30

标签: android android-studio intellij-idea appcompatactivity

我正在使用Android Studio,尽管旧项目文件夹中的所有项目都运行正常,但是当我尝试时 创建一个新项目,AS无法识别AppCompatActivity类

请查看build.gradle和样式文件夹

请让他们知道如何解决它

的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.example.com.myapplication"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

</resources>

更新:之后:com.android.support:appcompat-v7:23.1.1

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.android.support:appcompat-v7:23.1.1.
 Required by:
     MyApplication4:app:unspecified
  > Could not resolve com.android.support:appcompat-v7:23.1.1.
     > Could not get resource  
'https://jcenter.bintray.com/com/android/support/appcompat-  
 v7/23.1.1/appcompat-v7-23.1.1.pom'.
        > Could not GET  
'https://jcenter.bintray.com/com/android/support/appcompat-
v7/23.1.1/appcompat-v7-23.1.1.pom'.
           > Connection to https://jcenter.bintray.com refused

0 个答案:

没有答案
相关问题