我正在使用Android Studio开发我的应用。该应用程序适用于我的Android 5.1设备,但在尝试在其他设备(Android 4.2.2)上安装时,我收到多个dex文件错误。
为什么会发生这种情况?是否存在可能使我失望的版本依赖?
主要格式文件:
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0' }
App gradle:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.prasoon.mg"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
//used in main activity
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
//end
testCompile 'junit:junit:4.12'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.firebase:firebase-messaging:9.2.1'
// compile 'com.google.android.gms:play-services-gcm:9.0.0'
}
答案 0 :(得分:0)
将此添加到您的gradle
androidTestCompile('com.android.support:multidex:1.0.1') {
exclude group: 'com.android.support', module: 'multidex'
}
defaultConfig {
multiDexEnabled true
}