Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Ant Demo error class.newinstance()

Rank

Total Posts: 3

Joined 2013-01-17

PM

I want to test sample acquire channel demo on samsung galaxy s4.
I added the project in Eclipse.
Added ant_lib.jar fire from API folder.
I have insatlled AntRadioservice.apk
I have installed AntUSBservice.apk

when i debug the project, I am getting the error in class.newinstance() line 1319

this is logcat data:
07-15 14:12:34.604: I/dalvikvm(475): Debugger is active
07-15 14:12:34.704: I/System.out(475): Debugger has connected
07-15 14:12:34.704: I/System.out(475): waiting for debugger to settle...
07-15 14:12:34.904: I/System.out(475): waiting for debugger to settle...
07-15 14:12:35.104: I/System.out(475): waiting for debugger to settle...
07-15 14:12:35.305: I/System.out(475): waiting for debugger to settle...
07-15 14:12:35.505: I/System.out(475): waiting for debugger to settle...
07-15 14:12:35.705: I/System.out(475): waiting for debugger to settle...
07-15 14:12:35.905: I/System.out(475): waiting for debugger to settle...
07-15 14:12:36.105: I/System.out(475): waiting for debugger to settle...
07-15 14:12:36.306: I/System.out(475): waiting for debugger to settle...
07-15 14:12:36.506: I/System.out(475): waiting for debugger to settle...
07-15 14:12:36.706: I/System.out(475): waiting for debugger to settle...
07-15 14:12:36.906: I/System.out(475): waiting for debugger to settle...
07-15 14:12:37.106: I/System.out(475): debugger has settled (1482)
07-15 14:12:37.447: D/dalvikvm(475): threadid=1: still suspended after undo (sc=1 dc=1)
07-15 14:12:37.607: W/dalvikvm(475): VFY: unable to resolve exception class 32 (Lcom/dsi/ant/channel/ChannelNotAvailableException;)
07-15 14:12:37.607: W/dalvikvm(475): VFY: unable to find exception handler at addr 0x23
07-15 14:12:37.617: W/dalvikvm(475): VFY: rejected Lcom/dsi/ant/sample/acquirechannels/ChannelList;.addNewChannel (Z)V
07-15 14:12:37.617: W/dalvikvm(475): VFY: rejecting opcode 0x0d at 0x0023
07-15 14:12:37.617: W/dalvikvm(475): VFY: rejected Lcom/dsi/ant/sample/acquirechannels/ChannelList;.addNewChannel (Z)V
07-15 14:12:37.617: W/dalvikvm(475): Verifier rejected class Lcom/dsi/ant/sample/acquirechannels/ChannelList;
07-15 14:12:37.617: W/dalvikvm(475): Class init failed in newInstance call (Lcom/dsi/ant/sample/acquirechannels/ChannelList;)

I have attached the screenshots for my project configuirations & debug windows
download it from following link:

http://www.mediafire.com/download/68096358umeuv0j/SACDemo_error.screenshts.zip


please guide me to solve this error

thanks in Advance


     
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

This post should provide you with a good walk through.

The ANTLib library must be exported with your application; the error you are seeing is because Android can not find the classes you are using.

The simplest approach is to create a libs/ directory in your project and place the .jar file there (remove the manual library import you have added). You can also optionally add a preferences file to tell it where to pick up the javadoc.

Cheers,
-Rohan      
Rank

Total Posts: 3

Joined 2013-01-17

PM

rohan - 15 July 2014 04:11 AM
This post should provide you with a good walk through.

The ANTLib library must be exported with your application; the error you are seeing is because Android can not find the classes you are using.

The simplest approach is to create a libs/ directory in your project and place the .jar file there (remove the manual library import you have added). You can also optionally add a preferences file to tell it where to pick up the javadoc.

Cheers,
-Rohan


Thanks for quick reply

I have added the ANTlib in project workspace folder & given the javadoc path in preferances
but still i have same problem.
is this problem is regarding to the properties/projects? because there is no any projects are listed below these
project tab. please check the screenshot of properties.project.jpg in Attached screenshots.

http://www.mediafire.com/download/2lplqp9e4rz2jdq/SACDemo.Error.scrshts2.zip

I was struggling from last two weeks to solve this problem

please help me

     
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

You are still not including (exporting) the ANTLib library with your application binary. As explained by BK in the other thread, this will happen automatically if you place the .jar in libs/ like:
<your project>/libs/android_antlib_4-6-0.jar
Alternatively, in the "Order and Export" tab of "Java Build Path" check the box next to the ANTLibs entry you have manually created (which tells Eclipse to export the library during a build).

This is part of the basics of developing an Android application (not ANT specific), so I would suggest looking at the Android documentation on including libraries.