简体   繁体   English

android studio 3.0中的兼容性问题

[英]Facing Compatibility issue in android studio 3.0

I recently updated android studio to version 3.0 and now i am facing sdk compatibility issue means the app stops responding on sdk below 21 even after mentioning "minSdkVersion 15" in my gradle. 我最近将android studio更新到了版本3.0,现在我面临sdk兼容性问题,这意味着即使我在gradle中提到了“ minSdkVersion 15”,该应用也停止对低于21的sdk做出响应。 Please someone tell me how can I fix this issue? 请有人告诉我如何解决此问题?

Here is my gradle 这是我的礼物

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.example.demo.msts"
    minSdkVersion 15
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
         'proguard-rules.pro'
    }
}

dependencies {
implementation 'com.android.support:appcompat-v7:27.0.0'
compile('com.wdullaer:materialdatetimepicker:3.3.1') 
{
    exclude group: 'com.android.support'
}

implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.0.0'
implementation 'com.android.support:support-v4:27.0.0'
implementation 'com.android.support:support-compat:27.0.0'
implementation 'com.android.support:support-core-ui:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
implementation 'com.android.support:cardview-v7:27.0.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.android.support:support-core-utils:27.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:2.2.2'
}

Finally, I Solved this problem by including following line in "gradle dependencies". 最后,我通过在“渐变依赖项”中包含以下行来解决此问题。

implementation 'com.android.support:multidex:1.0.2'

and including "multiDexEnabled true" inside "defaultConfig" 并在“ defaultConfig”中包含“ multiDexEnabled true”

defaultConfig {
...
multiDexEnabled true
}

And in the manifest file I include below attribute inside "application" tag. 在清单文件中,我在“ application”标记内包含以下属性。

android:name="android.support.multidex.MultiDexApplication"

refered this https://developer.android.com/studio/build/multidex.html 引用了这个https://developer.android.com/studio/build/multidex.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM