codenameone / CameraKitCodenameOne

A cross platform API for low level camera access
3 stars 5 forks source link

issue using cameraKit #5

Closed DurankGts closed 5 years ago

DurankGts commented 5 years ago

please help me

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.github.sarxos.webcam.Webcam.(Webcam.java:101) at com.codename1.camerakit.impl.CameraNativeAccessImpl.getWebcam(Unknown Source) at com.codename1.camerakit.impl.CameraNativeAccessImpl.start(Unknown Source) at com.codename1.camerakit.CameraKit.start(CameraKit.java:72) at com.codename1.camerakit.demo.CameraKitDemo.start(CameraKitDemo.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.codename1.impl.javase.Executor$3$1.run(Executor.java:256) at com.codename1.ui.Display.processSerialCalls(Display.java:1298) at com.codename1.ui.Display.mainEDTLoop(Display.java:1093) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 14 more F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:1064: The following error occurred while executing this line: F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:805: Java returned: 1

DurankGts commented 5 years ago

Property codename1.arg.android.buildToolsVersion has a conflict at com.codename1.build.client.InstallLibsTask.mergeRequiredProperties(InstallLibsTask.java:243) at com.codename1.build.client.InstallLibsTask.unzip(InstallLibsTask.java:97) at com.codename1.build.client.InstallLibsTask.execute(InstallLibsTask.java:82) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.Target.performTasks(Target.java:456) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405) at org.apache.tools.ant.Project.executeTarget(Project.java:1376) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1260) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153) Property codename1.arg.android.buildToolsVersion has a conflict at com.codename1.build.client.InstallLibsTask.mergeRequiredProperties(InstallLibsTask.java:243) at com.codename1.build.client.InstallLibsTask.unzip(InstallLibsTask.java:97) at com.codename1.build.client.InstallLibsTask.execute(InstallLibsTask.java:82) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.Target.performTasks(Target.java:456) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405) at org.apache.tools.ant.Project.executeTarget(Project.java:1376) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1260) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153) warning: [options] bootstrap class path not set in conjunction with -source 1.6

DurankGts commented 5 years ago

check this issue compiling in android whit camera kit lib

error_170719_090ggggg0AM.txt

shannah commented 5 years ago

What IDE are you using?

DurankGts commented 5 years ago

net beans

shannah commented 5 years ago

Change the classpath of the <jar> call in the -post-jar target of the project's build.xml file to the following:

 classpath="${run.classpath}:${build.classes.dir}:lib/impl/native/javase">

The full target looks like:

<target name="-post-jar">
        <mkdir dir="native/javase" />
        <mkdir dir="native/internal_tmp" />
        <mkdir dir="lib/impl/native/javase" />
        <javac destdir="native/internal_tmp"
            encoding="${source.encoding}"
            source="1.8"
            target="1.8"
            classpath="${run.classpath}:${build.classes.dir}:lib/impl/native/javase">
            <src path="native/javase"/>
            <src path="lib/impl/native/javase"/>
        </javac>
        <copy todir="native/internal_tmp">
            <fileset dir="native/javase" excludes="*.java,*.jar"/>
            <fileset dir="lib/impl/native/javase" excludes="*.java,*.jar"/>
        </copy>        
    </target>

Then to a refresh-cn1libs

DurankGts commented 5 years ago

in the demo project or in the Library Project?

DurankGts commented 5 years ago

I have this same code

<target name="-post-jar">
    <mkdir dir="native/javase" />
    <mkdir dir="native/internal_tmp" />
    <mkdir dir="lib/impl/native/javase" />
    <javac destdir="native/internal_tmp"
        encoding="${source.encoding}"
        source="1.8"
        target="1.8"
        classpath="${run.classpath}:${build.classes.dir}:lib/impl/native/javase">
        <src path="native/javase"/>
        <src path="lib/impl/native/javase"/>
    </javac>
    <copy todir="native/internal_tmp">
        <fileset dir="native/javase" excludes="*.java,*.jar"/>
        <fileset dir="lib/impl/native/javase" excludes="*.java,*.jar"/>
    </copy>        
</target>

but when I compile the same issue it occur

ant -q -f F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo -Dnb.internal.action.name=run run Init env executing with cn1env = ${cn1env} for ../../CodenameOne/GUIBuilder/src Note: F:\data_kdp\programs\CodenameOne\ws_codenameone\CodenameOne\CodenameOne\src\com\codename1\processing\HashtableContent.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: F:\data_kdp\programs\CodenameOne\ws_codenameone\CodenameOne\CodenameOne\src\com\codename1\processing\HashtableContent.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller code size and wider device support Retina Scale: 1.0 java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.github.sarxos.webcam.Webcam.(Webcam.java:101) at com.codename1.camerakit.impl.CameraNativeAccessImpl.getWebcam(Unknown Source) at com.codename1.camerakit.impl.CameraNativeAccessImpl.start(Unknown Source) at com.codename1.camerakit.CameraKit.start(CameraKit.java:72) at com.codename1.camerakit.demo.CameraKitDemo.start(CameraKitDemo.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.codename1.impl.javase.Executor$3$1.run(Executor.java:256) at com.codename1.ui.Display.processSerialCalls(Display.java:1298) at com.codename1.ui.Display.mainEDTLoop(Display.java:1093) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 14 more F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:1056: The following error occurred while executing this line: F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:805: Java returned: 1 BUILD FAILED (total time: 15 seconds)

shannah commented 5 years ago

Demo project. This also assumes that you are using the cn1lib version installed via CodenameOneSettings . (i.e the latest released)

DurankGts commented 5 years ago

I 'm using the cn1lib version installed via CodeNameoneSettting and the issue it continue

ant -q -f F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo -Dnb.internal.action.name=run run Init env executing with cn1env = ${cn1env} for ../../CodenameOne/GUIBuilder/src Note: F:\data_kdp\programs\CodenameOne\ws_codenameone\CodenameOne\CodenameOne\src\com\codename1\processing\HashtableContent.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: F:\data_kdp\programs\CodenameOne\ws_codenameone\CodenameOne\CodenameOne\src\com\codename1\processing\HashtableContent.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller code size and wider device support Retina Scale: 1.0 java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.github.sarxos.webcam.Webcam.(Webcam.java:101) at com.codename1.camerakit.impl.CameraNativeAccessImpl.getWebcam(Unknown Source) at com.codename1.camerakit.impl.CameraNativeAccessImpl.start(Unknown Source) at com.codename1.camerakit.CameraKit.start(CameraKit.java:72) at com.codename1.camerakit.demo.CameraKitDemo.start(CameraKitDemo.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.codename1.impl.javase.Executor$3$1.run(Executor.java:256) at com.codename1.ui.Display.processSerialCalls(Display.java:1298) at com.codename1.ui.Display.mainEDTLoop(Display.java:1093) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 14 more F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:1056: The following error occurred while executing this line: F:\data_kdp\programs\CodenameOne\ws_codenameone\CameraKitCodenameOne\CameraKitDemo\nbproject\build-impl.xml:805: Java returned: 1 BUILD FAILED (total time: 26 seconds)

DurankGts commented 5 years ago

the version=6 of the cn1lib

shannah commented 5 years ago

Post your demo project's build.xml file please

DurankGts commented 5 years ago

<?xml version="1.0" encoding="UTF-8"?>

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
DurankGts commented 5 years ago

excuse me. Give me a moment

DurankGts commented 5 years ago

please check now. built.txt

DurankGts commented 5 years ago

Do you check my built file?