将 Android studio 更新到 3.1.2 后,我收到“无法加载 AppCompat ActionBar 并出现未知错误." [英] After Updating Android studio to 3.1.2 , I get "Failed to load AppCompat ActionBar with unknown error. "
问题描述
我尝试在 stackoverflow 上寻找其他类似的问题,他们建议我们使用buildToolsVersion"的 changw 版本,但我在我的 gradle 文件中没有看到这样的词.
I tried looking other similar questions on stackoverflow, they advice us to changw version of "buildToolsVersion" but I dont see word like that in my gradle file.
我的 Gradle 文件(项目):-
My Gradle File (PROJECT):-
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的 build.gradle (Module:app):这是我的第二个 gradle 文件
My build.gradle (Module:app): This the my second gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.dhruv.testhello"
minSdkVersion 15
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.1'
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'
}
推荐答案
我遇到了同样的问题.我搜索了这么多,我终于发现 appcompat-v7:28.0.0-alpha3
在 Android Studio 的设计视图"部分存在一些错误.
I had the same problem. I searched so much and I finally found that appcompat-v7:28.0.0-alpha3
has some bug with "Design View" part of Android Studio.
所以我建议将 com.android.support:appcompat-v7:28.0.0-alpha3
改为 com.android.support:appcompat-v7:28.0.0-alpha1
version 然后点击 File -> Invalidate Caches/Restart.沃拉一切正常.
So I suggest to change com.android.support:appcompat-v7:28.0.0-alpha3
to com.android.support:appcompat-v7:28.0.0-alpha1
version and then click File -> Invalidate Caches / Restart. Volla everything is OK.
当然,您应该可以上网下载com.android.support:appcompat-v7:28.0.0-alpha1
Of course you should have internet access to download com.android.support:appcompat-v7:28.0.0-alpha1
这篇关于将 Android studio 更新到 3.1.2 后,我收到“无法加载 AppCompat ActionBar 并出现未知错误."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!