0

I know there are multiple threads on this already but not a single fix worked so I figured I must have a unique issue or be making a stupid error that someone smart can point out.

I am trying to use the Realm Recyclerview (found here : https://github.com/thorbenprimke/realm-recyclerview)

However I cannot get the gradle sync to go beyond error 29,13 Failed to resolve com.github.thorbenprimke:realmr-ecyclerview:0.9.12

My app build.gradle file looks like this :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.harris.school"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile files('libs/joda-time-2.9.jar')
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'io.realm:realm-android:0.84.1'
    compile 'com.github.thorbenprimke:realm-recyclerview:0.9.12'
}

and the other one looks like this:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Thanks!

3 Answers3

0

I faced the same issue and resolved by adding maven repository URL like this

android{
    repositories{
       maven{
          url 'http://repo1.maven.org/maven2'
       }
    }
}

Hope this might helps you.

Geetha
  • 36
  • 5
0

I had the same problem. Solved it by adding below code to build.gradle

allprojects {
   repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
    jcenter()
      }
  }
-1

in the build.gradle file inside android {}, add this line

dexOptions {
    javaMaxHeapSize "4g"
}

like

android {
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

if its still not building, you might have to enable multidex

Look at this Stack Overflow post for how to enable multidex

gradle - Android Studio build too slow multidex application

Community
  • 1
  • 1
Aliyu Abdullahi
  • 129
  • 1
  • 4