×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    8

    Program works on Emulator but not on Phone 7210

    Hello,

    my name is martin.

    I'm trying to write a little small prog for my 7210 in java.

    I do not get many expirience with java.

    Now I wrote a little application and test it on the emulator (the emulator looks almost like my phone).

    On the emulator it works like it shoud, but after transfering on my phone it dosn't work.

    An error occures when I start the prog: "Invalid file".

    On compiling the compiler means:
    18.07.2003 13:27:07 java.util.jar.Attributes read
    WARNUNG: Duplicate name in Manifest: MIDlet-Name
    18.07.2003 13:27:07 java.util.jar.Attributes read
    WARNUNG: Duplicate name in Manifest: MIDlet-1
    ....and so on.....

    What is my problem and what is the solution?

    is my manifest-file wrong?

    Manifest-File:
    MIDlet-Name: Tester
    MIDlet-1: Tester, , Tester
    MIDlet-Description: Testapplication from Triman
    MIDlet-Info-URL: http://www.triman.ch/
    MIDlet-Jar-URL: Tester.jar
    MIDlet-Vendor: Triman GmbH
    MIDlet-Version: 1.0.0
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-1.0


    JAD-File:
    MIDlet-Name: Tester
    MIDlet-Version: 1.0.0
    MIDlet-Vendor: Triman GmbH
    MicroEdition-Profile: MIDP-1.0
    MicroEdition-Configuration: CLDC-1.0
    MIDlet-Jar-URL: Tester.jar
    MIDlet-Jar-Size: 1765
    MIDlet-1: Tester, , Tester

    Thanx for helping me!

    Martin

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Hi Martin!

    Does the error occur when you *start* the program, or when you try to install it? Are you installing from the Nokia Application Installer (by wire or IR), or over-the-air?

    I've had problems relating to JAD/MANIFEST content; the emulator does not much care about these, but the real phone is *very* fussy. If you think this is your problem, I'd suggest that you start by trimming them down to the minimum.

    I think the minimum is:

    MANIFEST.MF

    Manifest-Version: 1.0
    MIDlet-1: MyApp, /myicon.png, MainClass
    MIDlet-Name: MyApp
    MIDlet-Version: 1.2.3
    MIDlet-Vendor: Me
    MicroEdition-Profile: MIDP-1.0
    MicroEdition-Configuration: CLDC-1.0

    MyApp.jad

    MIDlet-1: MyApp, /myicon.png, MainClass
    MIDlet-Name: MyApp
    MIDlet-Version: 1.2.3
    MIDlet-Vendor: Me
    MIDlet-Jar-URL: MyApp.jar
    MIDlet-Jar-Size: 1234

    I don't think that the "Manifest-Version" item is required - I put it in while trying to get it to work, now it works so I daren't take it out again!! I haven't tried installing an app without an icon, so you might like to try adding one - you just need a small PNG file, say 12x12 or 14x14 pixels. When you add the icon path, use the full path to the icon in the jar, starting with a "/" (in my case, thats "/res/icon.png".

    (Wouldn't it be nice if anything told you *why* the file was invalid?!?!?)

    The Jar-Size *must* by correct, or it won't install. You might want to check that your jar file does contain everything you think. You can do this from a command line, using:

    jar tvf myapp.jar

    You should see your class files, and the manifest as META-INF/MANIFEST.MF.

    If you install onto the simulator using the -provisioning option (described in the documentation) it is more fussy and should perform the same checks as the real phone - and is just as terse in telling you there's a problem!!

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    8

    Got it

    Dear Graham,

    I installed a lot of Tools from Nokia and sun.

    So I was really confused wich one i need to use.

    But now I found one way - there are sure more then one-.

    I recreated the jar and jadfile with the tool "RunNDSforJ2ME"

    and now it works!

    My new jad-file looks like these:

    MIDlet-Name: Tester
    MIDlet-Version: 1.0.0
    MIDlet-Vendor: Triman GmbH
    MicroEdition-Profile: MIDP-1.0
    MicroEdition-Configuration: CLDC-1.0
    MIDlet-Jar-URL: Tester.jar
    MIDlet-Jar-Size: 1602
    MIDlet-Description: Testapplication from Triman
    MIDlet-Info-URL: http://www.triman.ch/
    MIDlet-1: Tester, , Tester


    Thanx a lot for help.

    Details:
    The error occurs when I start the application
    I don't know what the problem was!

    anyway, I wish you a nice weekend!

    Cheers from switzerland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×