本文介绍了错误:无法将请求的类放入单个dex文件中.请尝试提供main-dex列表. #方法:72477> 65536的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想添加融合的位置服务,但这显示了一些错误.帮我.
I want to add fused location services but it shows me some error.Help me.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.example.adil.bloodbankapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
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:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'junit:junit:4.12'
compile 'com.android.support:design:26.1.0'
compile 'com.github.joielechong:countrycodepicker:2.1.5'
compile 'com.jaredrummler:material-spinner:1.2.4'
compile 'hanks.xyz:htextview-library:0.1.5'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.google.android.gms:play-services:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
推荐答案
他们给您的答案都不是详尽无遗的.问题出在Multidex.您必须在应用程序gradle中添加库:
None of the answers they gave you were exhaustive.The problem lies in the Multidex.You must add the library in the app gradle :
implementation 'com.android.support:multidex:1.0.3'
之后,添加应用gradle的defaultConfig:
After, add in the defaultConfig of the app gradle :
multiDexEnabled true
您的应用程序必须是Multidex类型.您必须将其写在清单中:
Your Application must be of the Multidex type..You must write it in the manifest :
android:name=".MyApplication"
"MyApplication"必须是Multidex类,或者必须对其进行扩展.
"MyApplication" must be either the Multidex class, or it must extend it.
这篇关于错误:无法将请求的类放入单个dex文件中.请尝试提供main-dex列表. #方法:72477> 65536的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!