Giter Site home page Giter Site logo

Comments (6)

nmcdonaldd avatar nmcdonaldd commented on August 14, 2024

Having the same issue just running the debug apk file. Crashing after selecting a camera on Android 4.4.2 Samsung Galaxy Tab 8.1 Pro

from uvccamera.

nmcdonaldd avatar nmcdonaldd commented on August 14, 2024

Seems to be failing here. Says: java.lang.NoClassDefFoundError: com/serenegiant/usb/UVCCamera. But the other libraries load fine and I am not sure why if this one is going to fail. I'll keep researching.

from uvccamera.

nmcdonaldd avatar nmcdonaldd commented on August 14, 2024

Figured it out. This line and this line need to be changed to the correct directory path of your files. So for instance, I changed line 231 to com/thd/usbcameratest/usb/UVCCamera since that is my project structure, and it works fine then (and I did something similar for line 223). Would be nice to use some dependence injection principles here instead of having to hard code in the project structure. I might fork this and make this change.

from uvccamera.

saki4510t avatar saki4510t commented on August 14, 2024

Hi, I'm sorry answer is delay.

If you want to change class name or package name of UVCCamera.java, you also need to change native side as nmcdonaldd said. Additionally need to add proguard settings in proguard-project.txt for release build.

Currently it is like this.

-keepclassmembers public class com.serenegiant.usb.UVCCamera {
    public *;
    protected *;
    private *;
}

saki

from uvccamera.

chungithub avatar chungithub commented on August 14, 2024

hi,saik!
how to fix this issues? follow nmcdonaldd,line 231,line 223 no path setting can find.

static jint nativeSetFrameCallback(JNIEnv *env, jobject thiz,
ID_TYPE id_camera, jobject jIFrameCallback, jint pixel_format) {

jint result = JNI_ERR;
ENTER();                                                         //line 223
UVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);
if (LIKELY(camera)) {
    jobject frame_callback_obj = env->NewGlobalRef(jIFrameCallback);
    result = camera->setFrameCallback(env, frame_callback_obj, pixel_format);
}
RETURN(result, jint);

}
//line 231

from uvccamera.

saki4510t avatar saki4510t commented on August 14, 2024

Hi,

Di you see any error message on log cat? I assume you would forget to change line 846 of serenegiant_usb_UVCCamera.cpp to your FQN(fully qualified name).

As you can see on USBCameraTest5 project, nativeSetFrameCallback function(and it's dependency; UVCCamera#setFrameCallback and UVCPreview#setFrameCallback) does not depend on what class actually implements the IFrameCallback(but needs to keep existing the instance).

Although I'm not sure why you want to change FQN...you usually don't change FQN of any classes on Android SDK, Java libraries etc. don't you? I think in most case it is just increase useless trouble...

with best regards,
saki

from uvccamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.