如何解析'com.github.d-max:spots-dialog:0.7@aar'

时间:2019-03-13 12:44:38

标签: android build.gradle

我已完成所有解决方案,但没有一个起作用。每当我在项目中添加此库时。我遇到类似

的错误
  

无法解析该库(禁用脱机工作选项)。

禁用它后,错误就会出现

  

在离线模式下没有可用的缓存版本(启用离线工作选项)。

我如何解决它请帮忙

这是我的gradle文件(模块应用)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.amazone_ecommerce"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-database:16.1.0'
    implementation 'com.github.jd-alexander:android-flat-button:v1.1'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'io.paperdb:paperdb:2.1'
    implementation 'com.github.rey5137:material:1.2.4'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.firebaseui:firebase-ui-database:1.2.0'
    implementation 'com.squareup.picasso:picasso:2.3.2'
    implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    implementation 'com.github.mancj:MaterialSearchBar:0.7.1'
    implementation 'com.stepstone.apprating:app-rating:2.0.0'
    implementation 'com.squareup.retrofit2:retrofit-converters:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    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'

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

这是我的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.3.1'
        classpath 'com.google.gms:google-services:4.2.0'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

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

1 个答案:

答案 0 :(得分:0)

您应该按照documentation中的说明进行操作:

dependencies {
    implementation 'com.github.d-max:spots-dialog:1.1@aar'
}

那是lib的较新版本。我认为这应该可以解决您的问题。

最佳