Re: [android-building] EMMA_INSTRUMENT

605 views
Skip to first unread message

Ying Wang

unread,
Feb 21, 2013, 9:52:24 PM2/21/13
to android-...@googlegroups.com
Are you in the master branch?
If so, use EMMA_INSTRUMENT_STATIC=true
With EMMA_INSTRUMENT_STATIC, the emma library will be built into your apk;
on the other hand with EMMA_INSTRUMENT, it expects the emma library be in core.jar -- in that case you need a full clean build.

On Wed, Feb 20, 2013 at 9:06 PM, Senthil R <pr.sent...@gmail.com> wrote:
Hello,

I want to build instrumented application apk using the mm command (Android.mk)

using ant build system I'm able to generated instrumented apk.
ant emma instrument
TemperatureConverter-instrumented.apk

I have tried with EMMA_INSTRUMENT=true mm
The generated apk is getting crashed, when opening


I/dalvikvm( 2609): Could not find method com.vladium.emma.rt.RT.r, referenced from method com.example.i2at.tc.TemperatureConverterActivity.$VRi

W/dalvikvm( 2609): VFY: unable to resolve static method 112: Lcom/vladium/emma/rt/RT;.r ([[ZLjava/lang/String;J)V

D/dalvikvm( 2609): VFY: replacing opcode 0x71 at 0x0036

W/dalvikvm( 2609): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/i2at/tc/TemperatureConverterActivity;

W/dalvikvm( 2609): Class init failed in newInstance call (Lcom/example/i2at/tc/TemperatureConverterActivity;)

D/AndroidRuntime( 2609): Shutting down VM

W/dalvikvm( 2609): threadid=1: thread exiting with uncaught exception (group=0x40af51f8)

E/AndroidRuntime( 2609): FATAL EXCEPTION: main

E/AndroidRuntime( 2609): java.lang.ExceptionInInitializerError

E/AndroidRuntime( 2609): at java.lang.Class.newInstanceImpl(Native Method)

E/AndroidRuntime( 2609): at java.lang.Class.newInstance(Class.java:1319)

E/AndroidRuntime( 2609): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)

Emma version
[EMMA v2.1, build 14621]

Senthil R.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ying Wang

unread,
Mar 6, 2013, 12:35:36 PM3/6/13
to android-...@googlegroups.com


On Mon, Mar 4, 2013 at 4:48 PM, Senthil R <pr.sent...@gmail.com> wrote:
Ying,

Nope I'm 4.2.2 branch and have downloaded the emma 2.1 source to the AOSP code.
To add com.vladium.emma.ctl support in to the android apk.

when i use ant task "ant emma instrument"

The apk include the NotePad-instrumented.apk includes the emma_default.properties, emma_ant.properties and com.vladium.emma class files also bundled with the apk.
However when build as part of my full build using make or building the apk using mm. Those files are not getting integrated with the apk.

The platform build system use external/emma inside the Android source tree.
If you need a new version of emma, maybe it's easier to upgrade external/emma.
 
How to bundle those files into apk when it is built as part of mm or make.

Senthil R.

Ying Wang

unread,
Mar 6, 2013, 12:47:15 PM3/6/13
to android-...@googlegroups.com


On Tue, Mar 5, 2013 at 7:11 PM, Senthil R <pr.sent...@gmail.com> wrote:

Hello Ying,

 

Starting with build 2.1.5320 it is possible to dump or reset coverage data remotely and without a JVM exit.

http://emma.sourceforge.net/index.html

 

I have replaced the existing emma source files with the latest version and made changes to be compatible for the Android. Based on the ANDROID-CHANGES.txt

 

To generate emma.jar and emma_ant.jar.

 

I'm able to generate instrumented apk using "ant emma instrument". The application is working fine in the device.

 

However application is getting crashed, If I use mm command to build apk.

Try:
$  EMMA_INSTRUMENT_STATIC=true mm

 

Stack trace.

 

I/dalvikvm( 2609): Could not find method com.vladium.emma.rt.RT.r, referenced from method com.example.i2at.tc.TemperatureConverterActivity.$VRi

W/dalvikvm( 2609): VFY: unable to resolve static method 112: Lcom/vladium/emma/rt/RT;.r ([[ZLjava/lang/String;J)V

D/dalvikvm( 2609): VFY: replacing opcode 0x71 at 0x0036

W/dalvikvm( 2609): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/i2at/tc/TemperatureConverterActivity;

W/dalvikvm( 2609): Class init failed in newInstance call (Lcom/example/i2at/tc/TemperatureConverterActivity;)

D/AndroidRuntime( 2609): Shutting down VM

W/dalvikvm( 2609): threadid=1: thread exiting with uncaught exception (group=0x40af51f8)

E/AndroidRuntime( 2609): FATAL EXCEPTION: main

E/AndroidRuntime( 2609): java.lang.ExceptionInInitializerError

E/AndroidRuntime( 2609):  at java.lang.Class.newInstanceImpl(Native Method)

E/AndroidRuntime( 2609):  at java.lang.Class.newInstance(Class.java:1319)

E/AndroidRuntime( 2609):  at android.app.Instrumentation.newActivity(Instrumentation.java:1023)

Emma version
[EMMA v2.1, build 14621]

 

 

 

Kind Regards,

Senthil R.


On Tuesday, March 5, 2013 6:18:30 AM UTC+5:30, Senthil R wrote:
Ying,

Nope I'm 4.2.2 branch and have downloaded the emma 2.1 source to the AOSP code.
To add com.vladium.emma.ctl support in to the android apk.

when i use ant task "ant emma instrument"

The apk include the NotePad-instrumented.apk includes the emma_default.properties, emma_ant.properties and com.vladium.emma class files also bundled with the apk.
However when build as part of my full build using make or building the apk using mm. Those files are not getting integrated with the apk.

How to bundle those files into apk when it is built as part of mm or make.

Senthil R.


On Friday, February 22, 2013 8:22:24 AM UTC+5:30, Ying Wang wrote:

Ximing Chen

unread,
Apr 3, 2014, 2:55:06 AM4/3/14
to android-...@googlegroups.com
HI, Senthil R 
Has you solved the problem? I have the same problem like yours. And I build the apk with maven...

                            <plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<!-- emma start -->
<emma>
<enable>true</enable>
<classFolders>${project.basedir}/target/classes/</classFolders>
<outputMetaFile>${project.basedir}/target/emma/coverage.em</outputMetaFile>
</emma>
<!-- emma stop -->
<dex>
<noLocals>true</noLocals> <!-- must be set for emma -->
</dex>
                                     </plugin>




在 2013年2月21日星期四UTC+8下午1时06分38秒,Senthil R写道:
Reply all
Reply to author
Forward
0 new messages