人工发布不适用于android studio 3.4.1

时间:2019-05-19 19:53:07

标签: android-studio gradle artifactory

将android studio升级到3.4.1之后,它强制将我的gradle升级到5.1.1,但是每次我尝试部署工件时,它都显示如下:

02:45:06: Executing task ':uimodule_utils:artifactoryPublish'...

Executing tasks: [:uimodule_utils:artifactoryPublish]


> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :crashreport_utils
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :env_utils
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :gcmmodule2
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :netowrk_module
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :uimodule_utils
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Task :uimodule_utils:artifactoryPublish
> Task :artifactoryDeploy

BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed
02:45:07: Task execution finished ':uimodule_utils:artifactoryPublish'.

但它在我的工件中什么都没有显示,工件应显示为1.0.36

thumbnail

这是我的根项目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.4.1'
        classpath 'com.google.gms:google-services:3.1.0'
        classpath "io.realm:realm-gradle-plugin:3.1.4"
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.6"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
        maven {
            url "https://jitpack.io"
        }
    }
    repositories {
        maven {  url 'https://dl.bintray.com/netguru/maven/' }
    }
    apply plugin: "com.jfrog.artifactory"
    apply plugin: 'maven-publish'
}

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

我的应用程序优先级是:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 26



    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

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

}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    testImplementation 'junit:junit:4.12'
    implementation   'com.android.support:design:26.1.0'
    implementation 'com.github.ozodrukh:CircularReveal:2.0.1'
    implementation ('com.takisoft.fix:datetimepicker:1.0.6'){
        exclude group: 'com.android.support', module: 'appcompat-v7'

    }
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
    compile 'com.google.dagger:dagger:2.10'

    // Dagger Android dependencies
    annotationProcessor 'com.google.dagger:dagger-android-processor:2.10'
    compile 'com.google.dagger:dagger-android-support:2.10'
    implementation project(':app')
}
def libraryGroupId = '<<mygroup>>'
def libraryArtifactId = '<<myid>>'
def libraryVersion = '1.0.36'

publishing {
    publications {
        aar(MavenPublication) {
            groupId libraryGroupId
            version libraryVersion
            artifactId libraryArtifactId

            artifact("$buildDir/outputs/aar/${artifactId}-erelease.aar")
        }
    }
}

artifactory {
    contextUrl = 'http://<<myserver>>:8081/artifactory'
    publish {
        repository {
            repoKey = 'develop-local-libs'

            username = artifactory_username
            password = artifactory_password
        }
        defaults {
            publications('aar')
            publishArtifacts = true

            properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
            publishPom = true
        }
    }
}

请帮助我什至无法将我的库上传到服务器,并且在以前的android studio中效果很好

1 个答案:

答案 0 :(得分:0)

确定目录{apps dir}/outputs/aar/${artifactId}-erelease.aar中不存在该文件。文件名应位于<your_artifact_id>-erelease.aar目录内的/aar

您能告诉我build.gradle上的更改代码,特别是Publishing.publication部分吗?