Open frankbregulla1111 opened 11 years ago
Hi Franck,
I am pretty busy these days but I oughta work on QAT within a few days. I apologize for the delay, but you will be answered.
Stéphane
2013/6/5 Frank Bregulla notifications@github.com
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:
org.jraf android-switch-backport 1.0 apklib
Then add a switch view to your layout/main.xml:
<org.jraf.android.backport.switchwidget.Switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="switch"/>
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
— Reply to this email directly or view it on GitHubhttps://github.com/stephanenicolas/Quality-Tools-for-Android/issues/8 .
Stéphane NICOLAS, OCTO Technology Développeur & Consultant Android / Java .......................................................... 50, Avenue des Champs-Elysées 75008 Paris +33 (0)6.26.32.34.09 www.octo.com - blog.octo.com www.usievents.com ...........................................................
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. For me it seems like the dalvik runtime is not really getting along well with the instrumented bytecode. So probably this has to be fixed in jacoco...
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 : 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
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