我在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'
我已经意识到(使用调试模式)我的主要活动和我的两个片段都是在崩溃之前创建的。任何帮助将不胜感激。
答案 0 :(得分:0)
<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>
禁用hardwareAcceleration解决了我的问题。