首页 > 解决方案 > 配置项目 ':app' (org.gradle.api.ProjectConfigurationException) 时发生错误并且还发现 ERROR ASCII

问题描述

我正在尝试构建我的项目,但我在项目的 gradle 文件中遇到了一些错误,特别是 build.gradle(app) 文件。尝试构建项目时,出现以下错误:

1) org.gradle.api.ProjectConfigurationException: 配置项目':app'时出现问题

2)错误:也发现了 ASCII

另外,我无法查看我的 UI 设计。几天来我一直在与这个错误作斗争,我真的需要帮助来修复它。这是我的 build.gradle(app) 文件:

    apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId "com.onebookingsystem.obs"
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 16
        versionName "1.1.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    apply plugin: 'com.google.gms.google-services'

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    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.payumoney.sdkui:plug-n-play:1.0.0') {
            transitive = true;
            exclude module: 'payumoney-sdk'
        }

        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        //noinspection GradleCompatible
        compile 'com.android.support:appcompat-v7:26.+'
        compile 'com.android.support:support-v4:26.+'
        compile 'com.android.support:design:26.+'
        compile 'com.jjoe64:graphview:4.2.1'
        compile 'com.prolificinteractive:material-calendarview:1.4.3'
        compile 'de.hdodenhof:circleimageview:2.1.0'
//        compile 'com.matthew-tamlin:sliding-intro-screen:3.2.0'
        compile 'com.android.support:recyclerview-v7:26.+'
        compile 'com.squareup.picasso:picasso:2.3.2'
//    compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.daimajia.slider:library:1.1.5@aar'
        compile 'com.squareup.okhttp:okhttp:2.2.0'
        compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
        compile 'com.payumoney.core:payumoney-sdk:7.0.1'
        compile 'com.github.bumptech.glide:glide:3.5.2'
        compile 'com.github.clans:fab:1.6.2'
        compile 'com.android.support:cardview-v7:26.1.0'
        //firebase
        compile 'com.google.firebase:firebase-core:11.0.4'
        compile 'com.google.firebase:firebase-messaging:11.0.4'
        compile 'com.google.firebase:firebase-crash:11.0.4'
        compile 'com.google.firebase:firebase-config:11.0.4'
        compile 'com.firebase:firebase-client-android:2.5.2'
        compile 'com.google.firebase:firebase-auth:11.0.4'
        compile 'com.google.firebase:firebase-storage:11.0.4'
        compile 'com.google.firebase:firebase-database:11.0.4'
        compile 'com.crashlytics.sdk.android:crashlytics:2.9.1'

        compile 'com.intuit.sdp:sdp-android:1.0.5'
        implementation 'com.google.firebase:firebase-analytics:17.2.1'
        implementation 'com.google.firebase:firebase-auth:19.1.0'
        implementation 'com.google.firebase:firebase-firestore:21.3.0'

        //sms verify catcher
//    compile 'com.github.stfalcon:smsverifycatcher:0.3.2'
//    compile 'com.twilio:client-android:1.2.21'

        //spinner design
//    compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
        compile 'com.github.PhilJay:MPAndroidChart:v2.0.9'

        compile 'com.google.android.gms:play-services:11.0.4'
        testCompile 'junit:junit:4.12'
    }
}

apply plugin: 'com.google.gms.google-services'

标签: androidandroid-studioandroid-layoutandroid-fragmentsandroid-intent

解决方案


配置“编译”已过时,已替换为“实施”和“API”。您需要将所有内容更改为实施示例

 androidTestImplementation ('com.android.support.test.espresso:espresso-core:2.2.2',)

接下来,您需要将您的应用程序依赖项更新到您的构建工具 api 28 或更高版本。我注意到您正在使用不同版本的 firebase,这肯定会使您的应用程序崩溃。

另外,我无法查看我的 UI 设计。

最新的 firebase 依赖项位于 androidX 上,您需要将项目迁移到 androidX 。如下所示 然后


推荐阅读