项目级别Gradle文件:顶级构建文件,您可以在其中添加对所有子项目/模块通用的配置选项。在Android Studio中创建新项目时无法解析符号appCompatActivity?
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// 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
}
模块级gradle这个:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "in.co.persistent.gamedisappear"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
}
` 我知道这个问题被问了许多times.But我已经试过各种事情像无效/重启cache.Also试图重新启动Android和建设新项目.Plus添加了所需的依赖项(compile'com.android.support:appcompat-v7:25.0.1')没有任何作用!
请发布您的错误代码和gradle属性为您的应用程序:) –
我附上了我得到的错误图像! – Delfin
你会发布你的build.gradle文件吗? – TheAnonymous010