gradle未解决的依赖关系

时间:2019-06-11 12:37:26

标签: android gradle android-gradle dependencies

我在gradle文件中有问题。更新了Android Studio后,我还必须更新依赖关系,但是我担心会遇到无法解决的依赖关系

项目gradle:

buildscript {
repositories {
    mavenCentral()

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

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.4.1'
    classpath 'io.fabric.tools:gradle:1.29.0'
    classpath 'com.novoda:bintray-release:0.4.1'
    classpath 'com.google.gms:google-services:4.1.0'


}

}

allprojects {
repositories {

    maven { url 'https://maven.fabric.io/public' }

    jcenter()
}
}

应用gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'


android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
useLibrary  'org.apache.http.legacy'

defaultConfig {
    applicationId "com.packagename"
    minSdkVersion 21
    targetSdkVersion 28
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
    }
}

lintOptions {
    disable "ResourceType"
}
}

ext {
    googlePlayServicesVersion = "4.2.0"
}


dependencies {
implementation files('libs/icu4j-4_4_2_2.jar')
implementation files('libs/jsoup-1.6.3.jar')
implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar')
implementation files('libs/zip4j_1.2.6.jar')

implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
    transitive = true;
}

implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
// Google
implementation 'com.google.android.gms:play-services-auth:16.0.1'

implementation'com.google.firebase:firebase-auth:16.1.0'

// Firebase
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.3'


implementation 'com.google.android.gms:play-services-ads:17.2.1'

implementation project(':pdflibrary')
implementation 'com.android.support:support-compat:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:customtabs:27.0.2'

implementation files('libs/junit-4.3.jar')

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

implementation 'com.google.android.gms:play-services-flags:16.0.1'
implementation 'com.google.android.gms:play-services-basement:16.0.1'

implementation fileTree(dir: 'libs', include: ['*.jar'])
}

pdf库gradle:

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'



defaultConfig {
    minSdkVersion 24
    targetSdkVersion 28
    versionCode 1
    versionName '1'
}

sourceSets {
    main {
        jniLibs.srcDirs = ['libs']
    }
}
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
}

publish {
    userOrg = 'thefinestartist'
    groupId = 'com.thefinestartist'
    artifactId = 'finestwebview'
    publishVersion = '1'
    desc = 'Beautiful and customizable Android Activity that shows web pages within an app.'
    website = 'https://github.com/TheFinestArtist/FinestWebView-Android'
}

这是我知道将min-sdk设置为24的错误,并且我仅在gradle中,并且已将其从两个清单中删除(app和pdfLibrary): enter image description here

我尝试了其他SO问题的建议,但是没有任何效果, 感谢您的建议。

2 个答案:

答案 0 :(得分:1)

在pdfLibrary minSdkVersion中将21编辑为24而不是gradle

一个同步项目

答案 1 :(得分:1)

allprojects块中,您必须添加google() Maven存储库。

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