我试图在我的安卓项目中使用杰克·沃顿的ThreeTenABP库-- https://github.com/JakeWharton/ThreeTenABP --来实现JSR310的日期/时间特性。这个库的主要优点是它比Jodatime (http://www.joda.org/joda-time/)和三个碱基(https://github.com/ThreeTen/threetenbp)具有更少的编译开销。但是,ThreeTenABP库没有在我的项目中编译。我将在我的build.gradle中放置以下内容:
compile 'org.threeten:threetenbp:1.3-SNAPSHOT'
compile 'com.jakewharton.threetenabp:threetenabp:1.0.0-SNAPSHOT'我得到了一个编译错误:
错误:找不到org.treten:threetenbp:1.3-快照。要求:MyApp:app:未指定的MyApp:app:un期> com.jakewharton.threetenabp:threetenabp:1.0.0-SNAPSHOT在build.gradle文件中搜索
以前有人在Android上成功地使用过这个库吗?
发布于 2015-07-14 13:49:26
这是构建过程中的一个问题,无法下载依赖项。
这很可能是造成的,因为您还没有将快照存储库作为存储库中的自述文件说添加到项目中。
您应该能够通过将以下内容添加到顶级build.gradle文件中来解决此问题
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
}
}编辑:
这一评论是正确的,而且存储库本身也没有问题。问题是org.trieten:threetenbp:1.3-快照在这两个存储库中都不存在。( 装订盘或快照 )
编辑2:
请看一下这个项目的本期
JakeWharton在11小时前进行了注释,您需要ThreeTenBP项目notzdb分支的1.3快照。
编辑#3:
实际上,我刚刚看到是您创建了这个问题:)您需要自己构建它,因为它不是托管在任何存储库上的:
$ git clone https://github.com/ThreeTen/threetenbp
$ cd ThreeTen/
$ git checkout no-tzdb
$ mvn clean install另外,值得一提的是,ThreeTen有两个分离的项目,是分支所在的最后一个活动项目。
https://github.com/ThreeTen/threeten https://github.com/ThreeTen/threetenbp
https://stackoverflow.com/questions/31408516
复制相似问题