triniwiz / nativescript-videorecorder

:video_camera: NativeScript plugin for Video Recording . :video_camera:
Apache License 2.0
43 stars 29 forks source link

AdvancedVideoView: crash on Android #40

Closed Tronix117 closed 6 years ago

Tronix117 commented 6 years ago

If the demo apps cannot help and there is no issue for your problem, tell us about it

I have two different crashes everytime I try to load a AdvancedVideoView. Working smoothly on iOS, but crash on Android, with a different crash weither I set cameraPosition to back or front.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Here is the structure of the page (pretty simple):

Page.page--camera
  StackLayout
    AdvancedVideoView(
      quality="480p"
      cameraPosition="back"
      ref="camera"
      height="40%"
    )
    Button(@tap="$modal.close()" text="Back")

Is there any code involved?

Here is the crash report when I set to cameraPosition to front:


Here is the error appearing within the simulator when I set cameraPosition to back

An uncaught Exception occurred on "CameraThread" thread.
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
    at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6891)
    at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1083)
    at android.view.ViewGroup.invalidateChild(ViewGroup.java:5205)
    at android.view.View.invalidateInternal(View.java:13656)
    at android.view.View.invalidate(View.java:13620)
    at android.view.View.invalidateParentIfNeeded(View.java:13809)
    at android.view.TextureView.setTransform(TextureView.java:486)
    at co.fitcom.fancycamera.Camera2.configureTransform(Camera2.java:548)
    at co.fitcom.fancycamera.Camera2.access$100(Camera2.java:51)
    at co.fitcom.fancycamera.Camera2$1.onOpened(Camera2.java:224)
    at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:134)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.os.HandlerThread.run(HandlerThread.java:61)
Tronix117 commented 6 years ago

Ok, I removed everything, remove platform, re-add plugin, re-add platform, now I can't build anymore:

Running full build
.../platforms/android/app/src/main/java/com/tns/gen/co/fitcom/fancycamera/CameraEventListenerUI_fbundle_l62041_c68__.java:3: error: CameraEventListenerUI_fbun
dle_l62041_c68__ is not abstract and does not override abstract method onPhotoEventUI(PhotoEvent) in CameraEventListenerUI
public class CameraEventListenerUI_fbundle_l62041_c68__ extends co.fitcom.fancycamera.CameraEventListenerUI implements com.tns.NativeScriptHashCodeProvider {
       ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
triniwiz commented 6 years ago

That’s new I’ll look into it