Code Monkey home page Code Monkey logo

Comments (7)

pvasa avatar pvasa commented on May 28, 2024 1

I also do see this in the debugger: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelled}@d922855

@arvinkx good catch that was the exact issue. When a scope is created using CoroutineScope(coroutineContext) function, it attaches the scope to a new Job context. So when coroutineScope.cooutineContext.cancel() is called it cancels the job and thus no more coroutines can be created using that scope.

from cameraview-ex.

pcm2a avatar pcm2a commented on May 28, 2024

Is this reproducible in the sampleApp provided with the library?

from cameraview-ex.

arvinkx avatar arvinkx commented on May 28, 2024

Not sure, can't get the sample app to compile. It complains that File google-services.json is missing. The Google Services Plugin cannot function without it. Do I need to create a Firebase project in the console and download a google-services.json file to be able to run the sample app?

from cameraview-ex.

pcm2a avatar pcm2a commented on May 28, 2024

I had to include a google-services.json in order to compile it. I'm not sure why there is a need to have that in the project. @pvasa is that a dependency that could be removed? I also had to add gradle wrappers into a few sub projects.

from cameraview-ex.

arvinkx avatar arvinkx commented on May 28, 2024

I can confirm this issue exists in the sample app as well by leaving the app and coming back. Flash will fire but the picture is not taken and no preview is shown.

from cameraview-ex.

pvasa avatar pvasa commented on May 28, 2024

I had to include a google-services.json in order to compile it. I'm not sure why there is a need to have that in the project. @pvasa is that a dependency that could be removed? I also had to add gradle wrappers into a few sub projects.

@pcm2a @arvinkx The sampleApp demos barcode detection implementation using firebase api as a demo for preview frame listener that is why it requires google-services.json. Please refer this google help article for instructions on generating google-services.json

from cameraview-ex.

arvinkx avatar arvinkx commented on May 28, 2024

@pvasa Not really familiar with Kotlin but I believe the issue is related to this block of code in CameraView.kt:

override fun onPictureTaken(imageData: ByteArray) {
    coroutineScope.launch {
        pictureTakenListeners.forEach {
               it(imageData)
           }
      }
}

Once stop is called without removing the listeners, starting the camera again and calling capture in debug mode in the sample app, gets to the line with pictureTakenListeners but doesn't call the block inside launch when breakpoints are set. Hope this helps as I'm not really familiar enough with Kotlin to know why that block is not being called. I also do see this in the debugger: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelled}@d922855

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.