如何使我的应用程序与所有版本(4.4至28)兼容?

时间:2018-08-27 10:53:37

标签: android android-version

  1. 我在play store上有一个电子商务android应用程序,它将与实际设备上的android 8.0除外的所有android版本正常工作。

该应用程序在所有Android版本的模拟器上均可正常运行,但在Mi A1(8.1)上将崩溃,我没有该设备可以测试该应用程序。

如何解决这个问题?

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.ecommerce.app"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 4
        versionName "1.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support.constraint:constraint-layout:1.1.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.github.jd-alexander:LikeButton:0.2.3'
    compile 'org.apache.commons:commons-math3:3.6.1'
    compile 'org.apache.commons:commons-lang3:3.6'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-analytics:10.0.0'
    compile 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-library:0.1.0'
//    compile 'com.google.android.gms:play-services-appindexing:8.4.0'
    compile 'com.google.firebase:firebase-appindexing:10.0.0'
    compile files('libs/googlecollections-1.0.jar')
}
  1. 我如何使android应用程序与所有版本(4.4至28)兼容?

1 个答案:

答案 0 :(得分:0)

  1. 如果您对错误一无所知,则无法修复。您可以将Crashlytics或类似服务添加到您的应用中,以从客户端设备获取崩溃日志。

  2. 在build.gradle中将minSdkVersion参数设置为17,您将拥有与4.4以上的所有Android版本兼容的应用。