代码之家  ›  专栏  ›  技术社区  ›  Rohit Sharma

我的库未检测其渐变文件中提到的外部依赖项

  •  -1
  • Rohit Sharma  · 技术社区  · 6 年前

    我已经创建了一个库,当我导入它时,Gradle文件中提到的外部依赖项不会像RecyclerView、CameraView等那样被检测到。该库已经上载到Jitpack,并且没有检测到构建Gradle中的外部依赖项。 这是我的图书馆建筑系

    apply plugin:  'com.android.library'
    apply plugin: 'com.github.dcendents.android-maven'
    group='com.github.r00786'
    ext {
        PUBLISH_GROUP_ID = 'com.github'
        PUBLISH_ARTIFACT_ID = 'r00786'
        PUBLISH_VERSION = '1.8'
    }
    
    android {
        compileSdkVersion 27
        defaultConfig {
    
            minSdkVersion 15
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
    
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        implementation 'com.android.support:support-v4:27.1.1'
        testImplementation 'junit:junit:4.12'
        implementation 'com.wonderkiln:camerakit:0.13.1'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
         implementation 'com.android.support:recyclerview-v7:27.1.1'
        implementation 'com.android.support:cardview-v7:27.1.1'
        api("com.github.bumptech.glide:glide:4.6.1") {
            exclude group: "com.android.support"
        }
    
    
    
    }
    
    
    // build a jar with source files
    task sourcesJar(type: Jar) {
        from android.sourceSets.main.java.srcDirs
        classifier = 'sources'
    }
    
    task javadoc(type: Javadoc) {
        failOnError  false
        source = android.sourceSets.main.java.sourceFiles
        classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
        classpath += configurations.compile
    }
    
    // build a jar with javadoc
    task javadocJar(type: Jar, dependsOn: javadoc) {
        classifier = 'javadoc'
        from javadoc.destinationDir
    }
    
    artifacts {
        archives sourcesJar
        archives javadocJar
    }
    
    
    
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    

    //项目级生成渐变

    buildscript {
    
        repositories {
            google()
            jcenter()
            mavenCentral()
            maven { url 'https://jitpack.io' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Rohit Sharma    6 年前

      classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'