无法解析Android应用程序模块的Gradle配置。解决gradle构建问题和/或重新同步

时间:2020-10-12 09:21:42

标签: android firebase android-studio firebase-realtime-database

我刚完成我的android studio项目的设置,但在连接到Firebase时遇到问题,我已经尝试了所有针对类似问题的建议解决方案,但这些建议解决方案都不适合我。我现在迷失了如何做的选择。这是我的build.grade(模块应用程序和项目脚本)

apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
    applicationId "za.gov.mtubatuba.www.mtubayouthbase"
    minSdkVersion 15
    targetSdkVersion 30
    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 files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
String googleSupportVersion = '28.0.0'
//noinspection GradleCompatible
implementation "com.android.support:support-v4:$googleSupportVersion"
//noinspection GradleCompatible
implementation "com.android.support:appcompat-v7:$googleSupportVersion"
//noinspection GradleCompatible
implementation "com.android.support:design:$googleSupportVersion"
//noinspection GradleCompatible
implementation "com.android.support:recyclerview-v7:$googleSupportVersion"
//noinspection GradleCompatible
implementation "com.android.support:support-vector-drawable:$googleSupportVersion"


implementation('com.android.support:multidex:1.0.1') { force = true; }
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
//noinspection GradleCompatible
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.iceteck.silicompressorr:silicompressor:2.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

和我的build.gradle(project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.


 buildscript {
repositories {
    jcenter()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.1'
    classpath 'com.google.gms:google-services:4.2.0'
}
}


allprojects {
repositories {
    jcenter()
    maven{
        url 'https://maven.fabric.io/public'
    }
    google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:0)

现在全部排序。对我有用的是将gradle脚本上的编译更改为实现,然后将其连接到firebase