1. Download our Official Android App: Forums for Android!

Apps External Jar file error

Discussion in 'Android Development' started by dcreedon, Apr 2, 2010.

  1. dcreedon

    dcreedon Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Apr 2, 2010

    Apr 2, 2010
    2
    0
    5
    Hi,
    I have included an external jar file in eclipse as a user library. Everything compiles and deploys correctly to my android emulator.

    When it comes to calling the activity that uses the external jar classes it craps out. I set a breakpoint at the offending area and it is reporting that it cannot find the class that I was trying to use.

    The jar file is from Barbecue project

    Stack extract:

    ClassNotFoundException.<init>(String, Throwable) line: 59
    VMClassLoader.loadClass(String, boolean) line: not available [native method]
    BootClassLoader.findClass(String) line: 1057
    BootClassLoader.loadClass(String, boolean) line: 1124
    PathClassLoader(ClassLoader).loadClass(String, boolean) line: 567
    PathClassLoader(ClassLoader).loadClass(String) line: 532
    LoyaltyCard.outputtingBarcodeAsPNG() line: 32 :mad:
    LoyaltyCard.onCreate(Bundle) line: 21


    Please Help

    Damian
     

    Advertisement

  2. markb

    markb Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    148
    Joined:
    Sep 14, 2009

    Sep 14, 2009
    148
    26
    63
    Software Developer (Java, C, Web, Unix)
    Birmingham, UK
    Hi Damian,

    Don't forget that Android Java isn't standard Java. It uses its own JVM.
    Android will only recognise classes that were compiled with the Android java compiler, so standard java .class files that make up the external jar file won't work.

    If you have the source, and recompile using the Android SDK then you might have more luck.

    Mark
     

Share This Page

Loading...