- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在运行 gradlew install
时遇到以下错误。
Failed to capture snapshot of input files for task 'javadoc' during up-to-date check. See stacktrace for details.
Could not normalize path for file 'C:\android\sdk\platforms\android-23\android.jar;C:\android\sdk\platforms\android-23\optional\org.apache.http.legacy.jar'
项目的build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
库模块的build.gradle:
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
ext {
bintrayRepo = 'maven'
bintrayName = 'befrest'
publishedGroupId = 'com.oddrun.libraries'
libraryName = 'Befrest'
artifact = 'befrest'
libraryDescription = 'Simple Push Notification Library For Android'
siteUrl = 'https://github.com/hojjat-imani/PushNotif'
gitUrl = 'https://github.com/hojjat-imani/PushNotif.git'
libraryVersion = '0.0.1'
developerId = 'hojjat-imani'
developerName = 'Hojjat Imani'
developerEmail = 'imani.hojjat95@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 0
versionName "0.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}
version = libraryVersion
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
// Add your description here
name libraryName
description libraryDescription
url siteUrl
// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
最佳答案
您可以在您的 libs 文件夹中添加 org.apache.http.legacy.jar
。你可以在 Android/Sdk/platforms/android-23/optional
中找到这个 jar
我还将这一行添加到我的 app.gradle
文件中
compile files('libs/org.apache.http.legacy.jar')
但是如果你正在使用更多的库,你可以使用这种方式
compile fileTree(dir: 'libs', include: ['*.jar'])
这解决了我所有因谷歌取消对 Apache HTTP 客户端的支持而导致的错误。不要把compileSdkVersion 23
改成22
,我觉得这个方案比较好。
关于android - 无法规范化 bintrayUpload 中的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33773763/
我在运行 gradlew install 时遇到以下错误。 Failed to capture snapshot of input files for task 'javadoc' during up
我正在尝试将我的库发布到 bintray。但是创建的jar文件只包含一个META-INF文件夹,没有类文件。 我已按照 https://github.com/bintray/gradle-bintra
我正在尝试从 .proto 自动生成和部署 Java 库- 文件。第一部分,从我的.proto生成Java源代码-files 已经可以工作,并且 Jar 任务生成三个 .jar -文件:example
我正在学习本教程 https://antoniocappiello.com/2015/11/11/publish-your-library-to-jcenter-in-3-steps/发布我的第一个库
我想将我的图书馆上传到 jecenter。我已经创建了 bintray 帐户等并遵循了此处提到的所有步骤。 我在我的应用程序模块和库模块中做了以下更改。 //库build.gradle apply p
我遵循了将我的 AAR 文件发布到 JCenter 所需的每个步骤,然后使用 https://github.com/danielemaddaluno/gradle-jcenter-publish 将其
在更新gradle和android studio之前,我曾使用tutorial的这些任务将我的库上载到Bintray: 第一:gradlew install 第二个:gradlew bintrayUp
我正在尝试将 Android 库发布到 jcenter。我关注了https://github.com/danielemaddaluno/gradle-jcenter-publish教程。在我尝试执行之
我很长一段时间都面临这个错误: Execution failed for task ':lib-change-scene:bintrayUpload'. Could not create packag
我正在尝试将我的库上传到 jCenter。我正在学习本教程: http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-m
我的版本有什么问题? bintray.gradle apply plugin: 'com.jfrog.bintray' version = '0.1' task sourcesJar(type: Ja
我正在开发一个 android 库项目。我想将我的库上传到 JCenter。我已经创建了 bintray 帐户等并遵循了所有提到的步骤 here . 我在我的应用程序模块和库模块中做了以下更改。 应用
我是一名优秀的程序员,十分优秀!