当我通过 AppCompatActivity 扩展我的活动类时,它给了我无法解析symbole AppCompatActivity 。 我在我的gradle中使用了导入但它不起作用......
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:appcompat-v7:21.0.0'
import android.support.v7.app.AppCompatActivity;//Cannot resolve symbole AppCompatActivity
public class myActivity extends AppCompatActivity{//Cannot resolve symbole AppCompatActivity
.
.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mymain);
intilaizs();
action();
}
.
.
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.me.menu_2"
minSdkVersion 16
targetSdkVersion 21
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:21.+'
// compile 'com.android.support:appcompat-v7:21.0.+'
// compile 'com.android.support:appcompat-v7:21.0.0'
compile project(':MenuLibrary')
compile files('libs/gson-2.2.4.jar', 'libs/gson-2.2.4-javadoc.jar', 'libs/gson-2.2.4-javadoc.jar')
}
答案 0 :(得分:1)
在gradle文件中添加以下行:
compile 'com.android.support:design:23.3.0'
我希望这能解决你的问题。
答案 1 :(得分:0)
您需要添加compile 'com.android.support:support-v4:21.0.0'