-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage with jacoco offline instrumentation does not support apklibs #8
Comments
Hi Franck, I am pretty busy these days but I oughta work on QAT within a few days. I Stéphane 2013/6/5 Frank Bregulla notifications@github.com
Stéphane NICOLAS, |
Hi Stephane, I have looked a bit more into this. When I exclude all classes of the apklib by using the "excludes" or "includes" paramters of the maven instrument goal, the sample app can be started and coverage is measured. By excluding all apklibs of my real app from instrumentation, I manage to start the app. However it crashes in a lot of different places with java.lang.VerifyErrors, just by starting a different activity for example. |
Are there any status updates on this? |
Hi Stèphane,
thanks for your excellent quality tools project!
I try to setup code coverage measurement with jacoco on my project and use your project configuration as a base.
However my project has dependencies to apklibs what your project currently does not have.
Without apklibs, code coverage generation with jacoco works fine, but once I have such a dependency, running tests or even the app fails with a java.lang.VerifyError.
Do you have any idea, what could be the cause?
You can reproduce this quite easily by adding a dependency to say android-switch-backport to your sample project's pom.xml:
Then add a switch view to your layout/main.xml:
When you now make a mvn clean install -Pjacoco, the tests fail with this java.lang.VerifyError:
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 004a433a11d490af_LGE_Nexus4 found.
[INFO] 004a433a11d490af_LGE_Nexus4 : Running instrumentation tests in com.octo.android.sample.test
[INFO] 004a433a11d490af_LGE_Nexus4 : Run started: com.octo.android.sample.test, 4 tests:
[INFO] 004a433a11d490af_LGE_Nexus4 : Start [1/4]: com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute
[INFO] 004a433a11d490af_LGE_Nexus4 : ERROR:com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute
[INFO] 004a433a11d490af_LGE_Nexus4 : Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.VerifyError''. Check device logcat for details
[INFO] 004a433a11d490af_LGE_Nexus4 : End [1/4]: com.octo.android.sample.test.HelloAndroidActivityRobotiumTest#testCompute
And the stacktrace from logcat:
06-05 14:08:47.068: ERROR/AndroidRuntime(28587): FATAL EXCEPTION: main
java.lang.VerifyError: org/jraf/android/backport/switchwidget/Switch
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
at android.app.Activity.setContentView(Activity.java:1881)
at com.octo.android.sample.ui.HelloAndroidActivity.onCreate(HelloAndroidActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
I'm not sure whether this maybe is a problem with jacoco or the maven-android-plugin. What do you think?
Regards
Frank
The text was updated successfully, but these errors were encountered: