将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. "

查看:48
本文介绍了将Android Studio更新到3.1.2后,出现“无法加载未知错误的AppCompat ActionBar". "的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在stackoverflow上查找其他类似的问题,他们建议我们更改"buildToolsVersion"的版本,但在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版本,然后单击文件"->使缓存无效/重新启动". Volla一切都很好.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆