juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
756 stars 446 forks source link

New version doesn't compile on android #1051

Closed frederikstonge closed 4 weeks ago

frederikstonge commented 1 month ago

I updated from 5.0.1 to 5.0.2 to fix the torch, but my builds are now failing for android :

e: /home/vsts/.pub-cache/hosted/pub.dev/mobile_scanner-5.0.2/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt: (171, 61): Unresolved reference: entries e: /home/vsts/.pub-cache/hosted/pub.dev/mobile_scanner-5.0.2/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt: (171, 77): Unresolved reference: it

MishaKomar commented 1 month ago

Same on 5.0.0, 5.0.1, 5.0.2

gigafunk commented 1 month ago

same here maybe it was the removal of the embedded kotlin libraries and our projects are not finding native ones. I dunno, i am way over my head lol maybe somethign to do with gradle

joshuariveramnltech commented 1 month ago

same issue here, changed my version to 5.0.0-beta.3 and is able to build fine.

^5.0.0 seems to cause the issue. Any idea how to fix this?

arnabonetraker commented 1 month ago

5.0.2 has this issue. For now reverting back to 5.0.1 works

This declaration needs opt-in. Its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'

datpt11 commented 1 month ago

same issue

juliansteenbakker commented 1 month ago

Hi all, i have a possible fix for this on the master branch of this repository. If anyone can verify that this is working i can release a new version. Thanks!

EArminjon commented 1 month ago

Master compile well, please release :') !

I tested this (I took latest commit)

  mobile_scanner:
    git:
      url: https://github.com/juliansteenbakker/mobile_scanner.git
      ref: 695530aed11a7a0401ffcf7b3a80ec0e0532ea11
navaronbracke commented 1 month ago

@juliansteenbakker The upgrade of the Kotlin dependency must have broken things in 5.0.2 it seems (the entries declaration is available only for newer Kotlin version apparently)

Can we provide the onDetect / autoStart parameters specifically with a named constructor on the MobileScanner widget? Then we can assert that the arguments are not mixed up when a controller is provided. Or perhaps just with an assert?

navaronbracke commented 1 month ago

@juliansteenbakker I did a quick review and I have some feedback to make sure that the reinstated version won't cause regressions relating to how the functionality was brought back.

See my comments here: https://github.com/juliansteenbakker/mobile_scanner/commit/32d670da56ccc0afd66a73e901fddb565d0b6694

juliansteenbakker commented 1 month ago

Can we provide the onDetect / autoStart parameters specifically with a named constructor on the MobileScanner widget? Then we can assert that the arguments are not mixed up when a controller is provided. Or perhaps just with an assert?

I think its best to let the "old" not named paremeter in place so its not breaking, and indeed use an assert to check if the usage is not mixed up. I'm not against changes in the parameters, however i think we should have a deprecation marker first before (re)moving parameters so users know how to update.

navaronbracke commented 1 month ago

Indeed, I had only added the note in the changelog, but had forgotten to provide the deprecated annotation.

I will provide a pull request to address the small remarks that I had with the brought back API. You can expect these changes in the afternoon.

A-bahattab commented 1 month ago

same issue here

juliansteenbakker commented 4 weeks ago

I have released v5.1.0 which should solve this issue.