The publication process reference article http://blog.csdn.net/super_spy/article/details/77994278;
Here are the problems I encountered during the publishing process;
1. Unmappable characters that encode GBK
For the javaDoc encoding problem, I use the method of skipping the generation of javaDoc to avoid errors, which is not perfect, but does not affect the release;
Add the following code to the project's build.gradle:
tasks.getByPath(": Library Model name to upload: mavenAndroidJavadocs").enabled = false
The above method is only suitable for versions before gradle 4.1. After upgrading gradle 4.1 recently, it will report Task with path ': Library Model name to upload : mavenAndroidJavadocs' not found in root project 'Project'.
You need to modify this line of code to:
tasks.getByPath(": Library Model name to upload: releaseAndroidJavadocs").enabled = false
2、 HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
Reference articlehttp://blog.csdn.net/tmac2000/article/details/53261141
The main reason is that the account type of bintray was created incorrectly. The registration page has two entries, one is a free trial version and the other is an open source version. Because the style of the free trial version is more eye-catching, it was registered as a free trial version inadvertently; so Just re-register an open source version;
3. The problem of 'org.gradle.api.internal.component.Usage' reported by gradle4.1
The version of bintray-release that needs to be modified is:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.novoda:bintray-release:0.5.0'
}
4. The problem of "could not find com.android.tools.build:gradle:3.0.0." is reported when executing the gradle command in Terminal under gradle4.1
You need to add the library google() under repositories under buildscript as follows:
buildscript {
repositories {
jcenter()
google()//添加该库
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.novoda:bintray-release:0.5.0'
}
}
5. Gradle 4.1 reports the problem of "unmappable characters encoding GBK":
The following code needs to be added to the project's build.gradle:
tasks.getByPath(": Library Model name to upload: releaseAndroidJavadocs").enabled = false