gpt4 book ai didi

android - 预览在更新后停止工作

转载 作者:行者123 更新时间:2023-12-03 04:51:04 24 4
gpt4 key购买 nike

我在一个Android项目中工作,并且在 Adroid Studio 3.0 更新之后,出现了问题。

我的activities的预览停止显示数据,该项目仍在构建中,我可以安装在模拟器/电话上,但是我无法看到在XML布局中所做的所有更改,这是错误消息:

Failed to load AppCompat ActionBar with unknown error.

和那些错误:
- android.support.v7.widget.AppCompatImageView (Open Class, Show Exception, Clear Cache)
- android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.RecyclerView (Open Class, Show Exception, Clear Cache)
- android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.Toolbar (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.AppCompatTextView (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)
- android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)

我读了这个链接 here,这似乎是一个Gradle问题,我试图在git repo中恢复旧版本的Gradle,但是问题仍然存在,这是我的问题:
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '26.0.2'

lintOptions {
checkReleaseBuilds false
abortOnError false
}

defaultConfig {
applicationId "br.com.golfetto.golfettomobile"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "2017.11.07"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions { javaMaxHeapSize "4g" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':componentsutils')
compile group: 'com.google.guava', name: 'guava', version: 'r05'
compile 'com.github.barteksc:android-pdf-viewer:2.5.1'
compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile 'com.sackcentury:shinebutton:0.1.4'
compile 'net.colindodd:toggleimagebutton:1.2'
compile 'com.sackcentury:shinebutton:0.1.4'
compile 'net.colindodd:toggleimagebutton:1.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'br.com.livroandroid:android-utils:1.0.2'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.synnapps:carouselview:0.0.9'
compile 'se.emilsjolander:sprinkles:1.3.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.github.d-max:spots-dialog:0.4@aar'
compile 'com.antonionicolaspina:revealtextview:2.0'
compile 'com.jaredrummler:material-spinner:1.0.9'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'junit:junit:4.12'
compile 'com.bcgdv.asia.lib:fanmenu:1.2'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.chrisbanes:PhotoView:1.2.6'
testCompile 'junit:junit:4.12'
}

编辑:

为了澄清起见,我已经尝试过更改styles.xml中的主题,这是更改:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

对于那些有帮助的人,我表示感谢

最佳答案

您需要在build.gradle中使用相同版本的compileSdkVersionbuildToolsVersiontargetSdkVersionSupport Library。您需要更改为以下内容:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'

lintOptions {
checkReleaseBuilds false
abortOnError false
}

defaultConfig {
applicationId "br.com.golfetto.golfettomobile"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "2017.11.07"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions { javaMaxHeapSize "4g" }
}
dependencies {
...
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
}

Picking your compileSdkVersion, minSdkVersion, and targetSdkVersion上阅读有关它的文章

关于android - 预览在更新后停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47180031/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com