Search code examples
android-studioibeacon-android

RadiusNetwork's Android iBeacon Library


I'm trying to use the Android IBeacon Library in my application. I have added all dependencies in my gradle file and gradle sync fails with the following error:

Failed to refresh Gradle project 'IBeaconTest'
        Could not find com.radiusnetworks:AndroidIBeaconLibrary:0.7.6.
        Required by:
        IBeaconTest:ibeacon:1.0

This is my project's structure:

enter image description here

Update 1:

Module's build.gradle file(IbeaconTest/ibeacon/build.gradle):

apply plugin: 'android'

android {
compileSdkVersion 19
buildToolsVersion '19.0.1'

defaultConfig {
    minSdkVersion 18
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}

dependencies {
compile 'com.radiusnetworks:AndroidIBeaconLibrary:0.7.6@aar'
compile fileTree(dir: 'libs', include: ['*.jar'])
}

Main project's build.gradle(IBeaconTest/build.gradle):

buildscript {
repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.9.+'
}
}

allprojects {
repositories {
    mavenCentral()
}
}

Solution

  • Try putting the flatDir configuration in your module's build.gradle file.

    Like this:

    Module's build.gradle file(IbeaconTest/ibeacon/build.gradle):

    apply plugin: 'android'
    
    android {
    compileSdkVersion 19
    buildToolsVersion '19.0.1'
    
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    repositories {
        mavenCentral()
        flatDir {
            dirs 'libs'
        }
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    }
    
    dependencies {
      compile 'com.radiusnetworks:AndroidIBeaconLibrary:0.7+@aar'
      compile fileTree(dir: 'libs', include: ['*.jar'])
    }