你好,我正在尝试将我的Android应用程序连接到Firebase,但是当我单击connect按钮时,我收到以下消息“无法解析Android应用程序模块的Gradle配置。解决gradle构建问题和/或重新同步。” < / p>
这是我的gradle文件:
import com.google.gms.googleservices.GoogleServicesPlugin
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('./app/config/key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 28
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
defaultConfig {
applicationId "com.mcs.livraison_express"
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
versionCode 2
versionName "1.0.1-rc"
GoogleServicesPlugin.config.disableVersionCheck = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "version"
productFlavors {
development {
dimension "version"
// applicationIdSuffix ".dev"
versionNameSuffix "-dev"
getProps('./config/dev.properties').each { p ->
buildConfigField 'String', p.key, p.value
}
}
production {
dimension "version"
getProps('./config/prod.properties').each { p ->
buildConfigField 'String', p.key, p.value
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
/**
* Google liberies
*/
//implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.libraries.places:places:1.1.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-places:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.firebase:geofire-android:2.3.1'
apply plugin: 'com.google.gms.google-services'
/**
* Design
*/
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.GrenderG:Toasty:1.3.0'
implementation 'com.stepstone.stepper:material-stepper:4.3.1'
implementation 'com.github.badoualy:stepper-indicator:1.0.7'
implementation 'com.github.jaouan:compoundlayout:1.0.1'
implementation 'com.budiyev.android:circular-progress-bar:1.2.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.18'
implementation 'com.balysv:material-ripple:1.0.2'
/**
* image loader
*/
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
/**
* json annotations
*/
implementation 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
/**
* tools
*/
implementation 'com.github.douglasjunior:android-simple-tooltip:0.2.2'
//implementation 'com.github.jetradarmobile:android-snowfall:1.2.0'
implementation 'io.paperdb:paperdb:2.1'
implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.zplesac:connectionbuddy:2.0.0-beta1'
implementation 'com.jakewharton:butterknife:8.8.1'
//annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.github.thunder413:DateTimeUtils:1.0'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'com.github.andremion:counterfab:1.0.1'
/**
* retrofit2
*/
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
implementation 'org.jetbrains:annotations-java5:15.0'
/**
* bugsnag
*/
implementation ("com.bugsnag:bugsnag-android:4.+") {
exclude group: 'org.jetbrains', module: 'annotations'
}
androidTestImplementation "com.android.support:support-annotations:28.0.0"
}
def getProps(path) {
Properties props = new Properties()
props.load(new FileInputStream(file(path)))
return props
}
// To restrict developer to generate release build using Development URL,
android.variantFilter { variant ->
if(variant.buildType.name == 'release'
&& variant.getFlavors().get(0).name.equals('development')) {
variant.setIgnore(true)
}
}
起初,连接正常,但由于某些时候我无法再将应用程序连接到Firebase。