首页 > 解决方案 > 无法解决:com.android.support:support-v4:27.1.1。当我添加 graphview 依赖项时发生此错误

问题描述

我在工作室中有这个gradle。它工作正常但是当我尝试添加graphView的新依赖项时(编译'com.jjoe64:graphview:4.2.2')。它给了我无法解决错误。这是我的毕业典礼:

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
        maven { url "https://jitpack.io" }

    }
}

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

这是模块gradle:

   apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "28.0.1"
    defaultConfig {
        applicationId "com.example.yawarabbas.gymcoach_app"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

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

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    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:26.0.0-alpha1'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:support-core-ui:26.0.0-alpha1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.romandanylyk:pageindicatorview:1.0.2'
    compile 'com.google.code.gson:gson:2.4'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
    compile 'com.github.HotBitmapGG:RingProgressBar:V1.2.3'
    compile 'com.jjoe64:graphview:4.2.2'
}

如何解决?我已经阅读了很多解决方案,但它不起作用。

标签: androidandroid-studiogradleandroid-gradle-plugin

解决方案


推荐阅读