如何解决更改SDK版本时,遇到Theme.Dialog错误
我正在尝试为我的Android应用安装Firebase Crashlytics。所有版本的Firebase Crashlytics都接受16作为最低SDK。 minSdkVersion
14在我的应用程序中可用。当我将minSdkVersion
提高到16时,出现以下错误
C:\ Users \ Emircan \ Desktop \ mlxpos \ app \ src \ main \ res \ values \ styles.xml:2:5-5:13:AAPT:错误:资源android:style / android:Theme.Dialog找不到。
错误行:
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="editTextColor">@color/black</item>
<item name="android:dialogTheme">@android:style/android:Theme.Dialog</item>
</style>
如果我设置minSdkVersion
14,则会出现以下错误。
清单合并失败:uses-sdk:minSdkVersion 14不能小于在库[com.google.firebase:firebase-analytics:17.6.0]中声明的版本16,C:\ Users \ Emircan.gradle \ caches \ transforms- 2 \ files-2.1 \ cfbe933ef2af918ca181d266a71288ac \ firebase-analytics-17.6.0 \ AndroidManifest.xml,因为该库可能使用了14中不可用的API 建议:使用兼容的库,其minSdk最多为14 或将该项目的minSdk版本提高到至少16, 或使用tools:overrideLibrary =“ com.google.firebase.firebase_analytics”强制使用(可能会导致运行时失败)
我该如何解决? (crashlytics的最低版本是17.0.0,它也不接受。)
这是build.gradle(:app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
aaptOptions {
cruncherEnabled = false
}
dexOptions {
jumboMode true
}
compileSdkVersion 28
compileOptions.encoding = 'windows-1254'
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
applicationId "com.crash.app"
minSdkVersion 14
targetSdkVersion 28
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
debug {
/* Do not compile these resources in debug mode. Faster build time.
ext.enableCrashlytics = false
crunchPngs false */
minifyEnabled false
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
}
productFlavors {
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation "com.github.YarikSOffice:lingver:1.3.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation files('libs/AndroidEasingFunctions-1.0.0.jar')
implementation files('libs/AndroidViewAnimations-1.1.2.jar')
implementation files('libs/NineOldAndroid-2.4.0.jar')
implementation files('libs/achartengine-1.1.0.jar')
implementation files('libs/acra-4.7.0.jar')
implementation files('libs/apache-mime4j-core-0.7.2.jar')
implementation files('libs/httpclient-4.3.6.jar')
implementation files('libs/httpcore-4.4.3.jar')
implementation files('libs/httpmime-4.3.6.jar')
implementation files('libs/jsoup-1.10.1.jar')
implementation files('libs/logback-android-1.1.1-4.jar')
implementation files('libs/mpandroidchartlibrary-2-1-3.jar')
implementation files('libs/slf4j-api-1.7.6.jar')
implementation files('libs/d2xx.jar')
// Gprinter library
implementation files('libs/commons-lang-2.6.jar')
implementation files('libs/gprintersdkv2.1.3.jar')
implementation files('libs/jcc-bate-0.7.3.jar')
// Gprinter library finish
implementation 'com.facebook.fresco:fresco:1.3.0'
implementation 'com.github.clans:fab:1.6.4'
implementation 'androidx.multidex:multidex:2.0.0'
implementation(name: 'callerlibrary',ext: 'aar')
implementation(name: 'numbertowordsconverter',ext: 'aar')
// compile 'me.dm7.barcodescanner:zxing:1.9.8'
// implementation 'junit:junit:4.13-beta-2'
// implementation 'com.squareup.leakcanary:leakcanary-android:2.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
implementation 'com.google.firebase:firebase-analytics:17.6.0'
}
解决方法
好吧,如果您想使用Firebase Crashlytics
,则必须将sdk的最低版本至少升级到16。
将min sdk设置为16时遇到的问题是由较新版本(Theme.Dialog)中不存在的错误主题引起的。将其更改为Theme.AppCompat.Dialog
,就可以了。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。