I get this error while building:
Failed to sync Gradle project 'myapp'
Error:Could not find io.realm:realm-android:0.88.3.
Required by:
myapp:app:unspecified
Search in build.gradle files
In my project level gradle I have added as:
classpath "io.realm:realm-gradle-plugin:0.88.3"
In my module level:
compile 'io.realm:realm-android:0.88.3'
How to fix this error?
Project level gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'io.realm:realm-gradle-plugin:0.88.3'
}
}
Module level:
apply plugin: 'com.android.application'
apply from: '../config/quality/quality.gradle'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "xxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
debuggable true
}
release {
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'io.realm:realm-android:0.88.3'
//more dependencies here
}
From 0.88 onwards Realm is a plugin, not a compile dependency, so you need to apply the plugin realm-android
instead. It is also described here: https://realm.io/docs/java/latest/#installation
Top level build file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:0.88.3"
}
}
App level build file
apply plugin: 'realm-android'
In your case, your should remove:
dependencies {
compile 'io.realm:realm-android:0.88.3'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With