android-studio - 人工发布不适用于android studio 3.4.1

标签 android-studio gradle artifactory

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

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'.

但它在我的 Artifact 中什么都没有显示, Artifact 应显示为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
}

和我的应用程序gradle是:
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中工作正常

最佳答案

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

您能在build.gradle上,特别是在Publishing.publication部分上显示更改代码吗?

关于android-studio - 人工发布不适用于android studio 3.4.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56211505/

相关文章:

gradle - 是否可以选择在JUnit5/Gradle中用标签组合注释的测试?

android-studio - Android Studio - 项目中的所有文件名都是红色的,但没有错误

jenkins - 使用Artifactory Gradle插件在Jenkins Pipeline中设置项目版本

firebase - 默认 FirebaseApp 在此进程 com.example.example 中未初始化。确保首先调用 FirebaseApp.initializeApp(Context)

android - 无法将新的 APK 文件上传到 Android Play 商店(谷歌支付)

android - 匿名类可以用lambda提示替换

gradle - 使用Gradle从Artifactory下载最新版本

android - Android Studio 中的模拟器启动但未打开

gradle - 在Gradle中动态添加依赖项?

java - 从 Maven for Artifactory 本地下载 Artifact