我寻找已经提出的问题,但它们在旧版本的 android studio 上,并且不起作用。正如你所看到的,我没有 buildToolsVersion、compile 和 classpath .我的gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.illuminat.button"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
最佳答案
- 打开应用 Build.gradle 文件。
在依赖项中将:'com.android.support:appcompat-v7:28.0.0-alpha3'替换为 'com.android.support:appcompat-v7:28.0.0-alpha1'
点击同步。
关于android-studio - 无法加载 AppCompat ActionBar,出现未知错误。提示: Try to refresh the layout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50852323/