jeudi 2 avril 2015

Robolectric NoClassDefFoundError with external library

all my project activities inherits from a CustomActivity that is a external library i've created to help me with common usage things.


The problem is when i try to test that activity with robolectric i get this error:



java.lang.NoClassDefFoundError: br/com/androidcore/activity/CustomActivity


Any ideas? Should i shadow it? Should i put a reference into some Robolectric Config?


Here is my app build file:



apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "br.com.boozeprice"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

defaultConfig {
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'

compile project(':androidcore')
compile project(':persistencecore')

testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:2.4'
}


Thanks in advance


Aucun commentaire:

Enregistrer un commentaire