android cannot find realm gradle dependency -
i error while building:
failed 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 project level gradle have added as:
classpath "io.realm:realm-gradle-plugin:0.88.3"
in module level:
compile 'io.realm:realm-android:0.88.3'
how fix 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 plugin, not compile dependency, need apply plugin realm-android
instead. 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 case, your should remove:
dependencies { compile 'io.realm:realm-android:0.88.3' }
Comments
Post a Comment