材质设计不支持android 4及以下版本 [英] Material designing not supporting in android 4 and below versions
问题描述
我正在尝试构建Android 4及以下版本的应用程序,但是我的应用程序未在4以下版本的手机中显示UI设计
I am trying build my application Android version 4 and below versions but my application not showing UI designing in below 4 version mobiles
以上4版手机的设计正在显示,并且还可以正常工作,请有人帮我.
Above 4 version mobiles designing is showing and remaining also working fine can some one help me please.
一旦打开与4版以下手机的材料设计项目相关的应用程序,我可能会崩溃
And i am getting to may crashes once open application which are related to material designing items below 4 version mobiles
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.karvyclick.fos"
minSdkVersion 16
targetSdkVersion 26
versionCode 4
versionName "1.3"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
cruncherEnabled = false
}
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
defaultConfig{
vectorDrawables.useSupportLibrary = true
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
jumboMode true
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.code.gson:gson:2.7'
compile 'de.hdodenhof:circleimageview:2.1.0'
testCompile 'junit:junit:4.12'
//noinspection GradleCompatible
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.cocosw:bottomsheet:1.+@aar'
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
}
apply plugin: 'com.google.gms.google-services'
推荐答案
只需在清单的application
标签下将name
添加为MultiDexApplication
Just add name
under application
tag in manifest as MultiDexApplication
<application
....
android:name="android.support.multidex.MultiDexApplication"
...
</application>
编辑
在您的情况下,只需在现有的应用程序代码中添加以下代码段即可
In your case, just add below code snippet in your existing Application Tag
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
这篇关于材质设计不支持android 4及以下版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!