ziwert ziwert - 10 days ago 5
Android Question

How do I import SimMetrics to Android Studio project?

I want use SimMetrics in my app. I'm using Android Studio 2.2.2 with Gradle 2.2.2. I added this lines into my module

build.gradle


buildscript {
repositories {
mavenCentral()
}
}

dependencies {
compile group: 'com.github.mpkorstanje', name: 'simmetrics', version: '4.1.1'
}


And into my project
build.gradle
I added

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
//need this for ButterKnife
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}

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


Gradle sync successed, but I can't
import
anything from SimMetric, build just failes with
error: package org.simmetrics does not exist
.

How do I fix it?

Answer

I've given up and downloaded a *.jar from here and placed it in MyProject/MyModule/libs. I reverted old changes in build.gradle files and added this lines to module build.gradle

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile name: 'simmetrics-core-4.1.1' 
}