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

app crash when adding any android component to SceneObject #2020

Open
spakanati123 opened this issue Nov 9, 2018 · 4 comments
Open

app crash when adding any android component to SceneObject #2020

spakanati123 opened this issue Nov 9, 2018 · 4 comments
Labels

Comments

@spakanati123
Copy link

Hi,
all of sudden our app started crashing on launch and the crash is happening while adding any Android component to the SceneObject. I can reproduce the issue on given demo's gvr-events as well.
The crash trace is:

11-10 01:12:12.568 32440-32440/org.gearvrf.events E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.gearvrf.events, PID: 32440
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
        at android.view.ViewGroup.addViewInner(ViewGroup.java:5122)
        at android.view.ViewGroup.addView(ViewGroup.java:4953)
        at android.view.ViewGroup.addView(ViewGroup.java:4893)
        at android.view.ViewGroup.addView(ViewGroup.java:4866)
        at org.gearvrf.scene_objects.GVRViewSceneObject.addView(GVRViewSceneObject.java:273)
        at org.gearvrf.scene_objects.GVRViewSceneObject.access$100(GVRViewSceneObject.java:69)
        at org.gearvrf.scene_objects.GVRViewSceneObject$1.run(GVRViewSceneObject.java:215)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Requesting a quick update on this.
Thanks in advance

@ragner
Copy link
Contributor

ragner commented Nov 9, 2018

Hi @spakanati123,
Which constructor of GVRViewSceneObject are you using?
What version of GVRf are your using?
What branch of GVRf-Demos are you on?

@spakanati123
Copy link
Author

@ragner seems my demo branch is old and with the updated one it's working fine. I can see API diff to register android layout in the commit:
gearvrf/GearVRf-Demos@51c5d35#diff-7bcfc0e30ec452a2b0ad5aefb0c6b022

@spakanati123
Copy link
Author

spakanati123 commented Nov 13, 2018

@ragner when i am checking the gvr-videoplayer demo app the cursor not working with remote controller only in player screen when playing video(galley scene no issue) but it's working fine with track pad in player scene as well on samsung gear VR headset.
This is logic i seen in demo app.

  private void initCursorController() {
       mScene.getEventReceiver().addListener(mTouchHandler);
       GVRInputManager inputManager = mContext.getInputManager();
       inputManager.selectController(new GVRInputManager.ICursorControllerSelectListener() {
           public void onCursorControllerSelected(GVRCursorController newController, GVRCursorController oldController) {
               if (oldController != null) {
                   oldController.removePickEventListener(mTouchHandler);
               }
               mCursorController = newController;
               newController.addPickEventListener(mTouchHandler);
               newController.setCursor(createCursor());
               newController.setCursorDepth(-CURSOR_DEPTH);
               newController.setCursorControl(GVRCursorController.CursorControl.CURSOR_CONSTANT_DEPTH);
           }
       });
   }

But if i use built in API gvrContext.getInputManager().selectController(); remote working fine but this API not helpful for doing any customiztion , please suggest to fix the issue on demo app gvr-videoplayer.

I am using galaxy S8 device with Samsung Gear VR headset

@liaxim liaxim added the bug label Dec 11, 2018
@liaxim
Copy link
Contributor

liaxim commented Dec 17, 2018

@spakanati123 The cursor is not working in what way? I tried and it works pretty good if you use the trigger button for clicking. If you are clicking via the touch pad then there might be a problem which is a known issue. Is there any other demo app in which you experience this issue?

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

No branches or pull requests

3 participants