Code Monkey home page Code Monkey logo

Comments (5)

pvasa avatar pvasa commented on June 7, 2024

@srivnaimish would you mind adding some more info like lib version, device, etc. Try to fill the issue template as much as possible.

from cameraview-ex.

srivnaimish avatar srivnaimish commented on June 7, 2024

Describe the bug
App crash due to No element exception.
Happened few times so could not replicate.
Probably due absense of null check of sizes in camera2-

previewSizes.sizes(config.aspectRatio.value).chooseOptimalPreviewSize(preview.width, preview.height)

Not sure though.

Expected behavior
Camera should start without causing a crash.

Using ProGuard
with ProGuard

Library version - 3.1.1

Device :

Device: Xiaomi POCO F1
OS: 9.0.0
API: 28

from cameraview-ex.

pvasa avatar pvasa commented on June 7, 2024

@srivnaimish please update the lib version to 3.2.0. Many such issues were fixed in this release. Reopen the issue if you still see those crashes after updating.

from cameraview-ex.

srivnaimish avatar srivnaimish commented on June 7, 2024

Hey @pvasa updated the library but still getting the crash.
Stacktrace -
Fatal Exception: java.util.NoSuchElementException: Sequence is empty.
at kotlin.sequences.SequencesKt___SequencesKt.last(_Sequences.kt:202)
at com.priyankvasa.android.cameraviewex.extension.SortedSetExtensionsKt.chooseOptimalPreviewSize(SortedSetExtensions.kt:39)
at com.priyankvasa.android.cameraviewex.Camera2.startPreview(Camera2.kt:904)
at com.priyankvasa.android.cameraviewex.Camera2.access$startPreview(Camera2.kt:62)
at com.priyankvasa.android.cameraviewex.Camera2$1.invoke(Camera2.kt:77)
at com.priyankvasa.android.cameraviewex.Camera2$1.invoke(Camera2.kt:62)
at com.priyankvasa.android.cameraviewex.TextureViewPreview$1.onSurfaceTextureSizeChanged(TextureViewPreview.kt:62)
at android.view.TextureView.onSizeChanged(TextureView.java:372)
at android.view.View.sizeChange(View.java:19984)
at android.view.View.setFrame(View.java:19945)
at android.view.View.layout(View.java:19848)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1083)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1775)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:142)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:41)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1556)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:888)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1816)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1660)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1569)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:894)
at android.view.View.layout(View.java:19851)
at android.view.ViewGroup.layout(ViewGroup.java:6141)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2729)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2436)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1558)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7463)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1041)
at android.view.Choreographer.doCallbacks(Choreographer.java:847)
at android.view.Choreographer.doFrame(Choreographer.java:774)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1027)
at android.os.Handler.handleCallback(Handler.java:809)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7555)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)

from cameraview-ex.

pvasa avatar pvasa commented on June 7, 2024

@srivnaimish Is it a possibility that you are facing this issue because of a similar cause described in #163. If so you can try doing a clean build and see if the issue is fixed. If not then please reopen this issue and we can investigate more.

from cameraview-ex.

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.