我已从Github
下载了realm示例项目我导入了该项目。
最后我得到了以下错误。
Realm Gradle'示例'项目刷新失败
Error:Could not find io.realm:realm-gradle-plugin:1.2.0-SNAPSHOT.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/maven-metadata.xml
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.jar
file:/Users/govindaraj/.m2/repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/maven-metadata.xml
file:/Users/govindaraj/.m2/repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.pom
file:/Users/govindaraj/.m2/repository/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.jar
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.pom
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.jar
https://jitpack.io/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/maven-metadata.xml
https://jitpack.io/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.pom
https://jitpack.io/io/realm/realm-gradle-plugin/1.2.0-SNAPSHOT/realm-gradle-plugin-1.2.0-SNAPSHOT.jar
Required by:
io.realm:encryptionExample:1.2.0-SNAPSHOT
我该如何解决这个问题?
答案 0 :(得分:1)
如果你克隆了我们的整个仓库,你需要先从顶级目录运行./gradlew assemble
。在我们的自述文件中可能会更多地强调它
答案 1 :(得分:0)
确保build.gradle中有快照存储库
buildscript {
repositories {
maven {
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}
dependencies {
classpath "io.realm:realm-gradle-plugin:<version>-SNAPSHOT"
}
}
repositories {
maven {
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}