2015-08-19 101 views
-3

開始了一個新的Android項目,這是給默認的代碼表示could not resolve symbol r後,我做了sync project with gradle files,然後得到這些消息:錯誤檢索父項目,不能解析符號R

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

回答

0

你的問題不清楚明白你想要的是......它的近似答案。我想你更新了你的android studio但是沒有打開你的SDK &查看它的狀態。如果Android 6.0(API 23)可用,請安裝它的功能...... &然後打開build.gradle文件,在android studio &左邊的Gradle腳本類下檢查它的代碼,代碼應該是這樣的

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.0" 

    defaultConfig { 
     applicationId "com.example.inzi.app" 
     minSdkVersion 9 
     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']) 
    compile 'com.android.support:appcompat-v7:23.0.0' 
}