Android can not find the area gradle dependency

I get this error when creating:

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 gradle project level, I added as:

 classpath "io.realm:realm-gradle-plugin:0.88.3" 

At my module level:

 compile 'io.realm:realm-android:0.88.3' 

How to fix this error?

Gradle project level:

 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 } 
+5
source share
2 answers

Starting from 0.88, Realm is a plugin, not a compilation dependency, so you need to use the realm-android plugin. It is also described here: https://realm.io/docs/java/latest/#installation

Top Level Assembly File

 buildscript { repositories { jcenter() } dependencies { classpath "io.realm:realm-gradle-plugin:0.88.3" } } 

Application Level Build File

 apply plugin: 'realm-android' 

In your case, you should delete :

 dependencies { compile 'io.realm:realm-android:0.88.3' } 
+8
source

Step 1: add the following dependency of the path to the build.gradle file at the project level.

 buildscript { repositories { jcenter() } dependencies { //check & update 3.0.0 with latest version classpath "io.realm:realm-gradle-plugin:3.0.0" } } 

Step 2. Apply the realm-android plugin to the top of the application level build.gradle file.

 apply plugin: 'realm-android' 

Find the latest versions from https://realm.io/docs/java/latest/

enter image description here

+3
source

Source: https://habr.com/ru/post/1247404/


All Articles