【问题标题】:My library not detecting external dependencies mentioned in its gradle file我的库没有检测到其 gradle 文件中提到的外部依赖项
【发布时间】:2018-07-05 19:25:22
【问题描述】:

我创建了一个库,当我导入它时,没有检测到 gradle 文件中提到的外部依赖项,如 recyclerview、cameraview 等。该库已经上传到 jitpack 并且没有检测到构建中的外部依赖项毕业典礼 这是我的库的构建等级

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.

//项目级构建gradle

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
}

【问题讨论】:

    标签: java android android-studio gradle


    【解决方案1】:

    是maven插件1.5版本的bug 让它 2.0 就可以正常工作了

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

    【讨论】:

      猜你喜欢
      • 2023-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多