I am trying to run the example projects from the Realm git repository using Android Studio.
I find that when I open any of the example projects I get the following error:
Error:Could not find io.realm:realm-gradle-plugin:0.88.0-SNAPSHOT.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/maven-metadata.xml
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.jar
file:/Users/username/.m2/repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/maven-metadata.xml
file:/Users/username/.m2/repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.pom
file:/Users/username/.m2/repository/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.jar
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.pom
https://jcenter.bintray.com/io/realm/realm-gradle-plugin/0.88.0-SNAPSHOT/realm-gradle-plugin-0.88.0-SNAPSHOT.jar
Required by:
io.realm:adapterExample:0.88.0-SNAPSHOT
After some searching I found that someone else has encountered this issue previously and raised it as a git issue but can't understand how to implement the answer:
There is a chance our 0.88.0-SNAPSHOT hasn't been deployed yet. You can install it yourself locally by running ./gradlew installRealmJava from the root folder
The original user who asked the question doesn't confirm if this fixes his/her problem.
I have done further research on this solution which has lead me further and further from finding a solution as each problem requires further deviation from the original issue.
Considering this ticket is over a year old I am surprised that more people haven't come across the issue I have.
Any help or advice would be very appreciated.
Realm 0.88 has not been released to jCenter at the time of this writing (~9AM EST Feb 23 2016).
You can switch back to the latest build (0.87.4) by changing the contents of version.txt in the root directory. This, of course, will likely be missing some features so instead, as per the README you may want to add the OJO repository (and then you can use the 0.88-SNAPSHOT build):
If you want to test recent bugfixes or features that have not been packaged in an official release yet, you can use a -SNAPSHOT release of the current development version of Realm via Gradle, available on OJO
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'
}
}
Specifically, you must add:
maven {
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
to both the repositories nodes in the examples\build.gradle file (note I did this and successfully got the Realm-0.88-SNAPSHOT but then had a conflict with a support annotations library, so YMMV).
来源:https://stackoverflow.com/questions/35566024/problems-running-realm-could-not-find-io-realmrealm-gradle-plugin0-88-0-snaps