Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 4 of 4
  1. #1

    Android Java Exception Error. Need Help!

    So I had to replace my cracked screen. My camera worked fine before this. After I replaced it. I now get a forced closed message when trying to run the camera app. Or any other app that pulls up the camera. I have been looking into it. and when com.android.camera runs it looks like java blows up. SO I installed the dev tools and ran the exception browser to look at what the stack was reporting. Here is what i see in the stack trace.

    java.lang.RuntimeException: StartPreview failed
    >at com.android.camera.Camera.startPreview(Camera.java :1360)
    >at com.android.camera.Camera.accessS4000(Camera.java: 78)
    >at com.android.camera.CameraS3.run(Camera.java:724)
    >java.lang.Thread.run(Thread.java:1060)
    Caused by: java.lang.RuntimeException: startPreview failed
    >at android.hardware.Camera.startPreview(Camera.java:-2)
    >at com.android.camera.Camera.startPreview(Camera.java :1357)
    >at com.android.camera.Camera.accessS4000(Camera.java: 78)
    >at com.android.camera.CameraS3.run(Camera.java:724)
    >at java.lang.Thread.run(Thread.java:1060)

    Can anyone help me with diag on this? I am stuck. I luv to use shop savy and I also miss being able to snap pics of items that i need to referance later. Like a part for a car that i need to look up later in a parts catalog and i need to have an image of what it looks like. errrrrrr..

    thanks for the help!

  2. #2
    Janaaa's Avatar
    Member

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    73
    Downloads
    0
    Uploads
    0

    Android Java Exception Error. Need Help!

    http://www.netmite.com/android/mydroid/frameworks/base/core/jni/android_hardware_Camera.cpp

    Looks like it's not able to grab/connect to the native camera via JNI. Are you sure your camera is connected and working (and you've rebooted)?

  3. #3

    Android Java Exception Error. Need Help!

    I have rebooted many times, I took the screen back off and verified the ribbon cable is connected and the plug has a tiny lock lever, I also made sure that was in the lock position. this is wierd

  4. #4

    Android Java Exception Error. Need Help!

    An interesting line number there...

    I've worked with Java for 15 years. I used to teach it at degree level for 10 years. In all my life I've never seen a negative line number. However, I do know it is possible to have small negative numbers there when going through the jniThrowException method.

    Given the line numbers come from the line number table attribute in the class file, which maps blocks of byte code to line numbers of source code, one of only two ways I can think of seeing a negative (i.e. impossible) line number in there is if the class file is corrupted.

    By "rooted" in your signature, do you mean literally that (i.e. you have root level access?)? Or do you mean you've installed a custom firmware (which you need root level access in order to do)? If you have a custom firmware you may consider reinstalling it, or take the opportunity to update to one of the latest and greatest ones out there.

    However, the error does come from JNI, so it's possible it's just messing things up as I knew was possible above.

    Anyway, if it's not a corrupt class, then it's more than likely your camera wasn't reconnected properly when you had your screen replaced.

    I'm not 100% convinced of this though... Looking at the relevant bits of code...

    Code:
    static void android_hardware_Camera_startPreview(JNIEnv *env, jobject thiz)
    {
    ?? ?Camera *c = get_native_camera(env, thiz);
    ?? ?if (c == 0)
    ?? ? ? ?return;
    ?? ?
    ?? ?if (c->startPreview() != NO_ERROR) {
    ?? ? ? ?jniThrowException(env, "java/io/IOException", "startPreview failed");
    ?? ? ? ?return;
    ?? ?}
    }
    
    static Camera *get_native_camera(JNIEnv *env, jobject thiz)
    {
    ?? ?Camera *c = reinterpret_cast(env->GetIntField(thiz, fields.context));
    ?? ?if (c == 0)
    ?? ? ? ?jniThrowException(env, "java/lang/RuntimeException", "Method called after release()");
    
    ?? ?return c;
    }
    
    
    ??{ "startPreview",
    ?? ?"()V",
    ?? ?(void *)android_hardware_Camera_startPreview },
    ...you're not getting the "Method called after release()" error, so c (the camera object) isn't 0. That to me implies there's a camera detected. Or maybe just a driver for one?

    Anyway... my gut instinct is that while replacing your screen, the camera got disconnected (check the connections) or broken.

 

 

Quick Reply Quick Reply

Click here to log in


What is the number after 87?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-11-2011, 04:59 AM
  2. Replies: 0
    Last Post: 01-11-2011, 04:59 AM
  3. Sony Vegas Error: An exception has occurred?
    By The Host in forum Sony Ericsson
    Replies: 0
    Last Post: 12-21-2010, 05:01 AM
  4. Replies: 0
    Last Post: 10-17-2010, 03:20 AM
  5. Replies: 0
    Last Post: 05-04-2010, 02:33 PM

Bookmarks

Posting Permissions

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