android - 错误:无法解决:Android Studio 3.0.1中的appcompat-v7

标签 android android-studio gradle android-gradle-plugin

我正在面对这个问题,我已经做了所有必要的更改,但仍然面临
this issue

build.gradle(项目级别)

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

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

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

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

build.gradle(应用程序级别)
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven {
        url 'https://repo1.maven.org/maven2/'
    }
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 27
    buildToolsVersion '27.0.1'

    defaultConfig {
        applicationId "com.kiran.example.ebitcoin"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        // Enabling multidex support.
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true //support color.xml colors in vector image
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }

    useLibrary 'org.apache.http.legacy'
    // for EncodingUtils.getBytes(post_Data, "base64") in actrivitypaymentfrowebview

    sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/assets/font'] } }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
}

dependencies {
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.google.firebase:firebase-invites:11.0.4'
    implementation 'com.google.firebase:firebase-crash:11.0.4'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:27.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:27.0.1'
    compile 'com.android.support:support-v13:27.0.1'

    testCompile 'junit:junit:4.12'
    implementation 'com.android.support:cardview-v7:27.0.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }
    compile 'com.flurry.android:analytics:11.0.0@aar'//flurry sdk of yahoo for crashalytics

    //compile 'com.google.code.gson:gson:2.3.1'
    //compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.android.support:animated-vector-drawable:27.0.1'
    //compile 'com.android.support:customtabs:27.0.1'
    //compile 'com.android.support:palette-v7:27.0.1'
    compile 'com.android.support:recyclerview-v7:27.0.1'
    //to store object in shared pref
    // compile 'com.google.code.gson:gson:2.7'
    // Retrofit
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    // JSON Parsing
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'

    //add ripple below API 21
    //compile 'com.balysv:material-ripple:1.0.2'
    //add this dependency to scan QR code
    compile 'com.journeyapps:zxing-android-embedded:3.4.0'
    //material dialog
    // compile 'me.drakeet.materialdialog:library:1.3.1'
    //for setting GIF image
    //compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
    //for material dialogs
    //implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    //for sms otp
    //compile 'com.github.GoodieBag:Pinview:v1.3'

    //PayUMoney
    /* compile('com.payumoney.sdkui:plug-n-play:1.1.0') {
        transitive = true;
        exclude module: 'payumoney-sdk'
    }
    compile 'com.payumoney.core:payumoney-sdk:7.1.0'*/
    //for payment gateway
    compile 'com.android.volley:volley:1.1.0'
    //enable multiple methods
    compile 'com.android.support:multidex:1.0.0'
    //contry code selector
    //implementation 'com.hbb20:ccp:2.1.4'

    //appling font library to app
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'

    //file compression
    compile 'id.zelory:compressor:2.1.0'
    //async task test
    //compile 'com.loopj.android:android-async-http:1.4.9'
   // compile 'cz.msebera.android:httpclient:4.3.6'//upload images to api using this
    //progress dialog
    //compile 'com.github.d-max:spots-dialog:0.4'

    //to load
    compile 'com.github.bumptech.glide:glide:3.8.0'
    implementation files('libs/android-async-http-1.4.9.jar')
    implementation files('libs/android-async-http-1.4.9.jar')
}
apply plugin: 'com.google.gms.google-services'

最佳答案

确保所有support库具有相同版本。

关于android - 错误:无法解决:Android Studio 3.0.1中的appcompat-v7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50798555/

相关文章:

android - 将初始值设置为时间选择器

java - 卡在刷新 gradle 项目。幕后发生了什么?

gradle - 如何将依赖项部分中的所有源jar复制到gradle中的目录

Android Studio 3.1.2 gradle 构建错误

android - 有没有办法在没有任何额外操作的情况下从 'adb shell am' 调用 DataUsageSummary?

android - Listview Onitemclick 没有任何反应

java - 在不使用任何第三方的情况下将 map 数据映射到同一卡片 View 中的 Recyclerview Adapter

Android SDK Manager : Bug when connecting to a proxy (empty username), 你能确认吗?

java - 如何在 Android Studio 中从 pdf 或 excel 文件导入联系号码?

java - 如何将一个数字转换为另一个数字?