迁移到 androidx 后,Android 应用程序在 API 21 之前停止工作

标签 android crash migration androidx

我已将我们的项目迁移到 androidx,现在该应用程序可在 API 21 及更高版本上运行,但不能在该版本以下运行。该应用程序正在使用 multidexing 并且之前一直在使用它,效果很好。现在,当应用程序崩溃时,我只是收到一个致命信号 11 并且没有更多有用的日志。它在 API 21 及更高版本上仍然可以正常工作。您是否有任何线索或暗示我可以如何更接近于解决此问题?

10-19 15:16:01.024 11813-11813/com.mycompany.myproduct /libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 11813 ()
10-19 15:16:01.964 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.google.android.gms.internal.measurement.zzcc.cancel
10-19 15:16:01.964 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.google.android.gms.internal.measurement.zzcc.zzen
10-19 15:16:01.984 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
10-19 15:16:01.984 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
10-19 15:16:01.984 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'com.evernote.android.job.v21.PlatformJobService', referenced from method com.evernote.android.job.JobApi.isSupported
10-19 15:16:01.994 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'androidx.core.app.JobIntentService$JobServiceEngineImpl', referenced from method androidx.core.app.JobIntentService.onCreate
10-19 15:16:02.014 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.app.NotificationChannel', referenced from method io.intercom.android.sdk.push.SystemNotificationManager.setUpNotificationChannels
10-19 15:16:02.104 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper', referenced from method androidx.core.view.ViewCompat.addOnUnhandledKeyEventListener
10-19 15:16:02.104 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.dispatchApplyWindowInsets
10-19 15:16:02.104 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.onApplyWindowInsets
10-19 15:16:02.104 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'android.view.View$OnUnhandledKeyEventListener', referenced from method androidx.core.view.ViewCompat.removeOnUnhandledKeyEventListener
10-19 15:16:02.114 11902-11902/com.mycompany.myproduct E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$1', referenced from method androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener
10-19 15:16:02.804 11979-11979/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 15:16:02.804 11979-11979/? E/android.os.Debug: failed to load memtrack module: -2
10-19 15:16:03.104 2366-2734/com.google.android.gms.persistent E/NetworkScheduler: Unrecognised action provided: android.intent.action.PACKAGE_REPLACED
10-19 15:16:03.354 11902-11902/com.mycompany.myproduct A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 11902 ()



buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        mavenCentral()
        jcenter()
    }


    dependencies {
        classpath 'io.fabric.tools:gradle:1.26.1'
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
        classpath 'com.netflix.nebula:gradle-lint-plugin:9.3.4'

    }
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'com.jakewharton.hugo'




repositories {
    maven() {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    maven {
        url 'https://maven.fabric.io/public'
    }
    maven {
        url 'https://dl.bintray.com/intercom/intercom-maven'
    }
    maven {
        url "https://maven.google.com"
    }

    mavenCentral()
    maven { url "https://jitpack.io" }

}

android {

    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
    lintOptions {
        //checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
    defaultConfig {
        applicationId "com.mycompany.myproduct"
        minSdkVersion 16
        targetSdkVersion 28

        versionCode 1
        versionName "1.0"

        renderscriptTargetApi 28
        renderscriptSupportModeEnabled true
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

        testOptions {
            unitTests.returnDefaultValues = true
        }

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "bool", "branch_test", "false"
            resValue "string", "intercom_gcm_sender_id", "xxx"
        }
        debug {
            resValue "bool", "branch_test", "true"
            resValue "string", "intercom_gcm_sender_id", "xxx"
        }
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
        disable 'RestrictedApi'

    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    def lifecycle_version = "2.0.0"
    def paging_version = "2.0.0"

    // ViewModel and LiveData
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    implementation "androidx.paging:paging-runtime:$paging_version"

    testImplementation 'junit:junit:4.12'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    releaseImplementation project(':library')
    debugImplementation project(':library')
    releaseImplementation project(':countrypicker')
    debugImplementation project(':countrypicker')
    implementation project(':amazon-maps-api-v2')
    releaseImplementation project(':tourguide')
    debugImplementation project(':tourguide')
    releaseImplementation project(':fullscreenimageslider')
    debugImplementation project(':fullscreenimageslider')
    implementation files('libs/libphonenumber-7.2.5.jar')
    implementation('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true
    }
    testImplementation 'org.mockito:mockito-core:1.10.19'
    implementation('io.branch.sdk.android:library:2.+') {
        exclude module: 'answers-shim'
    }
    implementation 'com.thoughtbot:expandablerecyclerview:1.3'
    annotationProcessor 'com.airbnb:deeplinkdispatch-processor:3.1.1'
    implementation 'com.airbnb:deeplinkdispatch:3.1.1'
    implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-analytics:16.0.4'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'


    implementation 'com.squareup.picasso:picasso:2.6.0-SNAPSHOT'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.okio:okio:1.14.0'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.parse:parse-livequery-android:1.0.3', {
        exclude group: 'com.parse', module: 'parse-android'
    }
    implementation "com.github.parse-community.Parse-SDK-Android:parse:1.18.5"
    implementation "com.github.parse-community.Parse-SDK-Android:gcm:1.18.5"
    //implementation "com.parse:parse-android:1.16.7"
    implementation "com.github.parse-community.Parse-SDK-Android:ktx:1.18.5"

    implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.1@aar'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'de.hdodenhof:circleimageview:1.3.0'
    implementation 'jp.wasabeef:recyclerview-animators:2.0.1'
    implementation 'it.sephiroth.android.library.imagezoom:imagezoom:2.2.4'
    implementation 'com.mixpanel.android:mixpanel-android:4.6.4'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'com.github.paolorotolo:appintro:3.4.0',{
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'design'
        exclude group: 'com.android.support', module: 'gridlayout-v7'
    }
    implementation 'com.zhy:flowlayout-lib:1.0.3'
    implementation 'testfairy:testfairy-android-sdk:1.+@aar'
    implementation 'io.intercom.android:intercom-sdk-base:5.+',
    {
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'design'
        exclude group: 'com.android.support', module: 'gridlayout-v7'
    }
    implementation 'io.intercom.android:intercom-sdk-fcm:5.+'
    implementation 'com.google.guava:guava:24.1-jre'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:1.10.19'
    testImplementation 'org.robolectric:robolectric:3.3'
    testImplementation 'org.robolectric:shadows-multidex:3.3'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.slf4j:slf4j-android:1.7.25'

    implementation 'com.apollographql.apollo:apollo-runtime:0.4.3'
    implementation 'com.apollographql.apollo:apollo-android-support:0.4.3'
    implementation 'com.apollographql.apollo:apollo-http-cache:0.4.3'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-jackson:2.3.0'

    implementation 'com.philliphsu:bottomsheetpickers:2.4.1' ,{
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'design'
        exclude group: 'com.android.support', module: 'gridlayout-v7'
    }
    implementation group: 'com.cloudinary', name: 'cloudinary-android', version: '1.24.0'

}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.apollographql.android'
apply plugin: 'kotlin-android-extensions'

最佳答案

谢谢 sso.techie!所以是的,问题是/是渲染脚本......我做了与this中描述的相同的事情。关联。但我必须围绕 renderscript 构建兼容性,因为此解决方案在 API 23 之前不再适用。我仍然希望使用更新的 renderscript 支持版本找到解决方案

关于迁移到 androidx 后,Android 应用程序在 API 21 之前停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52885111/

相关文章:

android - GPU Overdraw 不适用于我在 Android 上的 apk

mysql - 如何在 mysql schema 上进行协作?

ios - 快速的 Alamofire 4.0

android - 如何在 Android 应用程序资源管理器中设置应用程序的可见性

安卓 : stop and play sound on button click

crash - 总线错误的可能原因:物理地址不存在

android - 当我声明我的按钮时,应用程序停止并且无法打开

xml - Scanload/loadstate USMT 使用我创建的自定义 XML 发出错误 26,该自定义 XML 应保存其他数据,错误表示元素内容丢失

android - WorkManager setRequiresDeviceIdle 令人困惑

c++ - C++ std::map 崩溃