java - 发射时的致命信号 (KitKat)
问题描述
我在 KitKat 上收到以下错误,但在 Android M 及更高版本上没有问题:
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'com.crashlytics.android.ndk.CrashlyticsNdk', referenced from method com.crashlytics.android.CrashlyticsInitProvider.createCrashlyticsKits
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'androidx.core.app.JobIntentService$JobServiceEngineImpl', referenced from method androidx.core.app.JobIntentService.onCreate
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$2', referenced from method androidx.core.view.ViewCompat.addOnUnhandledKeyEventListener
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.dispatchApplyWindowInsets
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.onApplyWindowInsets
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.view.View$OnUnhandledKeyEventListener', referenced from method androidx.core.view.ViewCompat.removeOnUnhandledKeyEventListener
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$1', referenced from method androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method androidx.appcompat.widget.AppCompatImageHelper.hasOverlappingRendering
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.view.textclassifier.TextClassificationManager', referenced from method androidx.appcompat.widget.AppCompatTextClassifierHelper.getTextClassifier
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.app.NotificationChannel', referenced from method co.ronash.pushe.Pushe.a
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method co.ronash.pushe.Pushe.a
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.app.NotificationChannel', referenced from method co.ronash.pushe.Pushe.createNotificationChannel
2145-2145/com.cafeapps.stroydownloader E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method com.google.android.material.tabs.TabLayout$TabView.updateBackgroundDrawable
2145-2145/com.cafeapps.stroydownloader A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128), thread 2145 (stroydownloader)
而且我相信唯一的错误是最后一行,因为其余的都可以忽略不计。这是我的 build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.cafeapps.stroydownloader"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
defaultConfig.vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
productFlavors {
....
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'
implementation 'com.libizo:customedittext:1.0.6'
implementation 'com.github.sabujak-sabujak:RoundedButton:v0.1.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'org.jsoup:jsoup:1.12.1'
implementation 'com.hmomeni.progresscircula:progresscircula:0.2.1'
implementation 'com.github.alirezat775:downloader:1.0.0'
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.6'
implementation 'com.github.halilozercan:BetterVideoPlayer:1.2.alpha1'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
implementation 'com.github.florent37:viewtooltip:1.2.2'
//Ads , firebase , ....
implementation 'com.google.android.gms:play-services-ads:16.4.1'
implementation 'com.google.firebase:firebase-ads:17.2.0'
implementation 'com.google.firebase:firebase-config:16.1.3'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
implementation 'co.ronash.android:pushe-base:1.6.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'ir.tapsell.sdk:tapsell-sdk-android:4.3.3'
implementation 'androidx.multidex:multidex:2.0.1'
}
apply plugin: 'com.google.gms.google-services'
我已经意识到(使用调试模式)我的主要活动和我的两个片段都是在崩溃之前创建的。任何帮助,将不胜感激。
解决方案
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.cafeapps.stroydownloader">
<application
....
android:hardwareAccelerated="false">
.....
</application>
</manifest>
禁用 hardwareAccelerationAndroidManifest.xml
解决了我的问题。
推荐阅读
- python - 如何将图像张量转换为张量流中的numpy数组?
- c# - 使用引导程序具有分页和多行选择功能的 Blazor 服务器端表?
- python - 如何使用相同的命令 discord.py 处理多个用户
- c# - ASP.NET MVC:OnResultExecuted 重定向
- python - 如何正确地将功能合并/加入另一个数据框
- oracle - 使用 JPA 将 ZonedDateTime 值插入带有时区列的 Oracle 时间戳
- python - 如何纠正 JSONDecoderError?
- linux - monogo 没有安装在 ubuntu 上
- python-3.x - Pandas - 删除时间戳
- html - 我想拉伸徽标的宽度并固定徽标的大小,使其清晰可见