渐变失败:ASCII



我使用的是android 3.0.1。我开始在android上使用firebase。在添加json文件并更新两个gradle文件后,我在屏幕顶部收到错误消息:gradle项目同步失败:基本功能(如编辑、调试(将无法工作。在下面的细条中:渐变失败:ASCII如下图所示

错误图像

当我点击下面pic的打开文件链接时,它会打开build.gradle(模块:应用程序(。为了解决这个问题,我尝试过:1-使用4.4.1级而不是当前级(文件->设置->梯度->使用本地梯度分布(。2-降级com.google.gms:google服务4.3.0或4.2.0-当前为4.3.3

但都没用。

知道吗?

build.gradle(项目(

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
       // classpath 'com.android.tools.build:gradle:4.4'
        classpath 'com.google.gms:google-services:4.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(模块(


apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.abdalla.home.ecommerce"
        minSdkVersion 23
        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 {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
  //  compile 'com.android.support:support-annotations:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-analytics:17.2.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

我在gradle.build上更改了依赖项-项目如下:

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.1.0'
    }

花了很长时间才成功同步,但最终还是成功了。我无法理解背后的逻辑。

最新更新