Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo code for basic usage throws a NullPointerException #8

Open
jsfan3 opened this issue May 15, 2020 · 1 comment
Open

Demo code for basic usage throws a NullPointerException #8

jsfan3 opened this issue May 15, 2020 · 1 comment

Comments

@jsfan3
Copy link

jsfan3 commented May 15, 2020

After fixing the build.xml adding the line mentioned in #3, I tried the demo code for basic usage reported in https://github.com/codenameone/CameraKitCodenameOne/blob/master/README.md, but it throws the same NullPointerException both on Simulator and on Android (I didn't test iOS):

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.RuntimeException: java.lang.NullPointerException
	at com.codename1.camerakit.impl.CameraNativeAccessImpl.getView(Unknown Source)
	at com.codename1.camerakit.CameraKit.getView(CameraKit.java:58)
	at net.informaticalibera.camerakittest.MyApplication.start(MyApplication.java:82)
	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:261)
	at com.codename1.ui.Display.processSerialCalls(Display.java:1303)
	at com.codename1.ui.Display.mainEDTLoop(Display.java:1097)
	at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
	at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.NullPointerException
	at com.codename1.camerakit.impl.CameraNativeAccessImpl.getWebcam(Unknown Source)
	at com.codename1.camerakit.impl.CameraNativeAccessImpl.getViewInternal(Unknown Source)
	... 12 more
Java Result: 1
@jsfan3
Copy link
Author

jsfan3 commented May 15, 2020

The line MyApplication.java:82 of the above log is:
hi.add(ck.getView());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant