classnotfoundexception - VerifyError from com.google.android.gms:play-services:4.4.52 dependency -
after including com.google.android.gms:play-services:4.4.52 dependency (for google+-login within android app) have problem running test cases robotium , junit on jenkins. seems no matter test case, test fails verifyerror (i've observed classnotfound- , noclassdeffounderror's afterwards). stacktraces:
verifyerror:
java.lang.verifyerror: org/catrobat/catroid/uitest/content/brick/setsizetobricktest @ java.lang.class.getdeclaredconstructors(native method) @ java.lang.class.getconstructors(class.java:508) @ android.test.suitebuilder.testgrouping$testcasepredicate.hasvalidconstructor(testgrouping.java:228) @ android.test.suitebuilder.testgrouping$testcasepredicate.apply(testgrouping.java:217) @ android.test.suitebuilder.testgrouping$testcasepredicate.apply(testgrouping.java:213) @ android.test.suitebuilder.testgrouping.select(testgrouping.java:172) @ android.test.suitebuilder.testgrouping.selecttestclasses(testgrouping.java:162) @ android.test.suitebuilder.testgrouping.testcaseclassesinpackage(testgrouping.java:156) @ android.test.suitebuilder.testgrouping.addpackagesrecursive(testgrouping.java:117) @ android.test.suitebuilder.testsuitebuilder.includepackages(testsuitebuilder.java:102) @ android.test.instrumentationtestrunner.oncreate(instrumentationtestrunner.java:358) @ pl.polidea.instrumentation.polideainstrumentationtestrunner.oncreate(polideainstrumentationtestrunner.java:432) @ android.app.activitythread.handlebindapplication(activitythread.java:4335) @ android.app.activitythread.access$1500(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1256) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method)
classnotfoundexception:
java.lang.classnotfoundexception: org.catrobat.catroid.test.utils.simulatedsensormanager @ java.lang.class.classforname(native method) @ java.lang.class.forname(class.java:251) @ android.test.classpathpackageinfosource.createpackageinfo(classpathpackageinfosource.java:88) @ android.test.classpathpackageinfosource.access$000(classpathpackageinfosource.java:39) @ android.test.classpathpackageinfosource$1.load(classpathpackageinfosource.java:50) @ android.test.classpathpackageinfosource$1.load(classpathpackageinfosource.java:47) @ android.test.simplecache.get(simplecache.java:31) @ android.test.classpathpackageinfosource.getpackageinfo(classpathpackageinfosource.java:72) @ android.test.classpathpackageinfo.getsubpackages(classpathpackageinfo.java:48) @ android.test.classpathpackageinfo.addtoplevelclassesto(classpathpackageinfo.java:61) @ android.test.classpathpackageinfo.gettoplevelclassesrecursive(classpathpackageinfo.java:55) @ android.test.suitebuilder.testgrouping.testcaseclassesinpackage(testgrouping.java:156) @ android.test.suitebuilder.testgrouping.addpackagesrecursive(testgrouping.java:117) @ android.test.suitebuilder.testsuitebuilder.includepackages(testsuitebuilder.java:102) @ android.test.instrumentationtestrunner.oncreate(instrumentationtestrunner.java:358) @ pl.polidea.instrumentation.polideainstrumentationtestrunner.oncreate(polideainstrumentationtestrunner.java:432) @ android.app.activitythread.handlebindapplication(activitythread.java:4335) @ android.app.activitythread.access$1500(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1256) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method) caused by: java.lang.noclassdeffounderror: org/catrobat/catroid/test/utils/simulatedsensormanager ... 27 more caused by: java.lang.classnotfoundexception: didn't find class "org.catrobat.catroid.test.utils.simulatedsensormanager" on path: dexpathlist[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/org.catrobat.catroid.test-1.apk", zip file "/data/app/org.catrobat.catroid-1.apk"],nativelibrarydirectories=[/data/app-lib/org.catrobat.catroid.test-1, /data/app-lib/org.catrobat.catroid-1, /vendor/lib, /system/lib]]
the (relevant part of) build.gradle file:
buildscript { repositories { mavencentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.0.1' classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+' // classpath 'com.google.gms:google-services:1.3.0-beta1' } } repositories { mavencentral() } apply plugin: 'android-sdk-manager' apply plugin: 'com.android.application' apply plugin: 'checkstyle' apply plugin: 'pmd' apply from: 'gradle/adb_tasks.gradle' apply from: 'gradle/code_quality_tasks.gradle' apply from: 'gradle/intellij_config_tasks.gradle' //apply plugin: 'com.google.gms.google-services' check.dependson 'checkstyle' check.dependson 'pmd' android { compilesdkversion 23 buildtoolsversion '23.0.0' defaultconfig { minsdkversion 16 targetsdkversion 23 applicationid 'org.catrobat.catroid' testapplicationid "org.catrobat.catroid.test" testinstrumentationrunner 'pl.polidea.instrumentation.polideainstrumentationtestrunner' versioncode 24 println "versioncode " + versioncode versionname "0.9.17" println "versionname " + versionname buildconfigfield "string", "git_describe", "\"${versionname}\"" buildconfigfield "string", "git_current_branch", "\"${getcurrentgitbranch()}\"" } defaultconfig { multidexenabled = true } } ext { projectversion = "0.9" } configurations { compile.exclude group: 'xpp3' //compile problem xstream natives } dependencies { compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' compile 'com.android.support:support-v4:19.1.0' compile 'com.android.support:multidex:1.0.1' compile 'com.google.guava:guava:18.0' compile ('com.squareup.okhttp:okhttp:2.3.0') { exclude group: 'com.android.support', module: 'support-v4' exclude group: 'com.google.android.gms' } compile ( 'com.google.code.gson:gson:2.3.1') { exclude group: 'com.android.support', module: 'support-v4' exclude group: 'com.google.android.gms' } compile 'com.github.johnpersano:supertoasts:1.3.4@aar' compile 'com.thoughtworks.xstream:xstream:1.4.7' def gdxversion = '1.6.2' compile 'com.badlogicgames.gdx:gdx:' + gdxversion compile 'com.badlogicgames.gdx:gdx-backend-android:' + gdxversion natives 'com.badlogicgames.gdx:gdx-platform:' + gdxversion + ':natives-x86' natives 'com.badlogicgames.gdx:gdx-platform:' + gdxversion + ':natives-armeabi' natives 'com.badlogicgames.gdx:gdx-platform:' + gdxversion + ':natives-armeabi-v7a' compile 'com.facebook.android:facebook-android-sdk:4.4.0' compile 'com.google.android.gms:play-services:4.4.52' //compile 'com.google.android.gms:play-services-plus:7.8.0' //compile 'com.google.android.gms:play-services:7.8.0' compile filetree(include: '*.jar', dir: 'catroid/libs') compile filetree(include: '*.jar', dir: 'catroid/libs-natives') androidtestcompile filetree(include: '*.jar', dir: 'catroidtest/libs') androidtestcompile 'com.jayway.android.robotium:robotium-solo:5.2.1' androidtestcompile 'com.google.dexmaker:dexmaker:1.2' androidtestcompile 'com.google.dexmaker:dexmaker-mockito:1.2' androidtestcompile 'org.mockito:mockito-core:1.10.19' pmd 'net.sourceforge.pmd:pmd:5.1.1' checkstyle 'com.puppycrawl.tools:checkstyle:6.7' } task copyandroidnatives() { file("catroid/jnilibs/armeabi/").mkdirs(); file("catroid/jnilibs/armeabi-v7a/").mkdirs(); file("catroid/jnilibs/x86/").mkdirs(); configurations.natives.files.each { jar -> def outputdir = null if(jar.name.endswith("natives-armeabi-v7a.jar")) outputdir = file("catroid/jnilibs/armeabi-v7a") if(jar.name.endswith("natives-armeabi.jar")) outputdir = file("catroid/jnilibs/armeabi") if(jar.name.endswith("natives-x86.jar")) outputdir = file("catroid/jnilibs/x86") if(outputdir != null) { copy { ziptree(jar) outputdir include "*.so" } } } } if (project.hasproperty('jenkins')) { project.android.dexoptions.predexlibraries = false project.android.dexoptions.javamaxheapsize = "2048m" }
on device (nexus 4 lollipop) app running without problems when signing in google+. within android studio tests seem run without these exceptions. i've tried disable bytecode verification during testing like:
tasks.withtype(test) { scanfortestclasses = false include "**/*test.class" test { // set jvm arguments test jvm(s) jvmargs '-xx:-usesplitverifier' } }
but still had same errors.
also note, haven't compiled current version 'com.google.android.gms:play-services:7.8.0' or 'com.google.android.gms:play-services-plus:7.8.0', respectively, because first need replace actionbarsherlock appcompat (otherwise won't compile). i'm not sure whether need apply 'com.google.gms.google-services' plugin (seems work without plugin) - haven't included yet because changes task structure, our automated jenkins test system depends on.
even after hours of searching don't understand why happens.
Comments
Post a Comment