【发布时间】:2019-02-02 22:12:41
【问题描述】:
我正在尝试将我的 APK 上传到 Nexus 存储库。 在我更改 gradle 版本之前,下面的代码可以正常工作
来自
类路径'com.android.tools.build:gradle:2.3.3' distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip mCompileSdkVersion=23 mBuildToolsVersion='25.0.0'
收件人
类路径'com.android.tools.build:gradle:3.1.0' distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip mCompileSdkVersion=27 mBuildToolsVersion='27.0.0'
更改版本后相同的代码不起作用我无法理解我发现错误的位置,终端没有显示任何错误消息但我的 APK 没有上传到给定位置
以下是我的 App build.gradle 文件的当前配置
apply plugin: 'com.android.application'
apply plugin: 'maven'
task uploadRelease (type: Upload){
configuration = project.getConfigurations().getByName('archives');
repositories {
mavenDeployer {
repository( url: "http://XXXXXXXX:8081/nexus/XXXXXXXX/repositories/releases" ) {
authentication(userName: "MyuserName", password: "Mypassword")
}
pom.project {
version "${android.defaultConfig.versionName}"
artifactId "Collection"
name "xxxxxxxx"
groupId "com.xxxxxxxx.mobile.xxxxxxxx.collections"
}
}
}
}
task uploadSnapshot (type: Upload){
configuration = project.getConfigurations().getByName('archives');
repositories {
mavenDeployer {
repository( url: "http://XXXXXXXX:8081/nexus/XXXXXXXX/repositories/snapshots" ) {
authentication(userName: "MyuserName", password: "Mypassword")
}
pom.project {
version "${android.defaultConfig.versionName}-SNAPSHOT"
artifactId "Collection"
name "Collection"
groupId "com.xxxxxxxx.mobile.xxxxxxxx.collections"
}
}
}
}
我使用命令作为 - gradle assemblerelease uploadsnapshot
构建和上传 APK 但它不适用于 gradle 4.4 请让我知道出了什么问题
【问题讨论】:
-
使用
gradle assemblerelease uploadsnapshot --debug --info --stacktrace收集更多信息并发布错误日志。
标签: android android-studio gradle upload snapshot