Comments (3)
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 [email protected]
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
apklibThen 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#testComputeAnd 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//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
...........................................................
from quality-tools-for-android.
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...
from quality-tools-for-android.
Are there any status updates on this?
from quality-tools-for-android.
Related Issues (20)
- PIT mutation testing HOT 1
- PMD check doesn't seem to work (for gradle) HOT 2
- add selendroid
- support for JBehave?
- Findbugs classpath configuration HOT 2
- EasyMock / java.lang.NoClassDefFoundError: com/google/dexmaker/stock/ProxyBuilder HOT 1
- java.lang.NoClassDefFoundError: lombok/ast/AstVisitor HOT 1
- What's the operating system of these code test on? HOT 2
- androidTest with jacoco and robolectric with jacoco
- Can not execute SonarQube analys is: Unable to execute Sonar: Fail to parse the Surefire report
- Where is the espresso dependency for the maven setup HOT 2
- Task for PMD, Checkstyle, Findbugs
- classycle reports generation does not work
- Possible Error During Findbugs
- Maven build fails on Mac JDK 1.6 HOT 1
- Coverage on multi modules maven project
- Where is the Espresso Artifact for Maven?
- junit 4 is now supported
- UiAutomator + Gradle + Test Reports HOT 1
- Missing dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quality-tools-for-android.