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
744 stars 444 forks source link

Android App is not building after just adding the package. #1013

Closed governedbyprudence closed 1 month ago

governedbyprudence commented 1 month ago

Just installed the package and tried to run it.

`Invalid depfile: /Users/punnyarthabanerjee/Documents/self/test/smartshoe/smartshoe_updated/.dart_tool/flutter_build/710d553141eb6386dc53d9663a40286f/kernel_snapshot.d Invalid depfile: /Users/punnyarthabanerjee/Documents/self/test/smartshoe/smartshoe_updated/.dart_tool/flutter_build/710d553141eb6386dc53d9663a40286f/kernel_snapshot.d ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:2:8: Error: Dart library 'dart:html' is not available on this platform. import 'dart:html'; ^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:150:5: Error: Type 'VideoElement' not found. VideoElement source, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:156:5: Error: Type 'VideoElement' not found. VideoElement element, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:161:5: Error: Type 'MediaStream' not found. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:162:5: Error: Type 'VideoElement' not found. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:168:5: Error: Type 'VideoElement' not found. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:174:12: Error: Type 'VideoElement' not found. external VideoElement prepareVideoElement(VideoElement videoSource); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:174:45: Error: Type 'VideoElement' not found. external VideoElement prepareVideoElement(VideoElement videoSource); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:178:5: Error: Type 'VideoElement' not found. VideoElement videoElement, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:179:5: Error: Type 'MediaStream' not found. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:182:32: Error: Type 'VideoElement' not found. external bool isVideoPlaying(VideoElement video); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:187:12: Error: Type 'VideoElement' not found. external VideoElement? videoElement; ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:190:12: Error: Type 'MediaStream' not found. external MediaStream? stream; ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:238:28: Error: Type 'VideoElement' not found. void prepareVideoElement(VideoElement videoSource) { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:244:5: Error: Type 'MediaStream' not found. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:245:5: Error: Type 'VideoElement' not found. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:150:5: Error: 'VideoElement' isn't a type. VideoElement source, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:156:5: Error: 'VideoElement' isn't a type. VideoElement element, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:161:5: Error: 'MediaStream' isn't a type. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:162:5: Error: 'VideoElement' isn't a type. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:168:5: Error: 'VideoElement' isn't a type. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:174:45: Error: 'VideoElement' isn't a type. external VideoElement prepareVideoElement(VideoElement videoSource); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:178:5: Error: 'VideoElement' isn't a type. VideoElement videoElement, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:179:5: Error: 'MediaStream' isn't a type. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:182:32: Error: 'VideoElement' isn't a type. external bool isVideoPlaying(VideoElement video); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:187:12: Error: 'VideoElement' isn't a type. external VideoElement? videoElement; ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:190:12: Error: 'MediaStream' isn't a type. external MediaStream? stream; ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:238:28: Error: 'VideoElement' isn't a type. void prepareVideoElement(VideoElement videoSource) { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:244:5: Error: 'MediaStream' isn't a type. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:245:5: Error: 'VideoElement' isn't a type. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/zxing.dart:269:9: Error: The method 'allowInterop' isn't defined for the class 'ZXingBarcodeReader'.

Detailed import paths for (some of) the these imports:

package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/base.dart => dart:html
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => dart:html
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => package:mobile_scanner/src/web/base.dart => dart:html
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => dart:html
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => package:mobile_scanner/src/web/base.dart => dart:html

../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:32:9: Error: Type 'html.DivElement' not found. final html.DivElement videoContainer; ^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:69:3: Error: Type 'html.MediaStream' not found. html.MediaStream? localMediaStream; ^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:70:9: Error: Type 'html.VideoElement' not found. final html.VideoElement video = html.VideoElement(); ^^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:77:10: Error: Type 'html.MediaStream' not found. Future<html.MediaStream?> initMediaStream(CameraFacing cameraFacing) async { ^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:97:28: Error: Type 'html.VideoElement' not found. void prepareVideoElement(html.VideoElement videoSource); ^^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:100:5: Error: Type 'html.MediaStream' not found. html.MediaStream stream, ^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:101:5: Error: Type 'html.VideoElement' not found. html.VideoElement videoSource, ^^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:32:14: Error: 'DivElement' isn't a type. final html.DivElement videoContainer; ^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:69:8: Error: 'MediaStream' isn't a type. html.MediaStream? localMediaStream; ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:70:14: Error: 'VideoElement' isn't a type. final html.VideoElement video = html.VideoElement(); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:70:40: Error: Method not found: 'VideoElement'. final html.VideoElement video = html.VideoElement(); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:80:14: Error: Undefined name 'window'. html.window.navigator.mediaDevices?.getSupportedConstraints(); ^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:93:20: Error: Undefined name 'window'. await html.window.navigator.mediaDevices?.getUserMedia(constraints); ^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:97:33: Error: 'VideoElement' isn't a type. void prepareVideoElement(html.VideoElement videoSource); ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:100:10: Error: 'MediaStream' isn't a type. html.MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:101:10: Error: 'VideoElement' isn't a type. html.VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/base.dart:129:41: Error: The method 'promiseToFuture' isn't defined for the class 'InternalTorchDetection'.

Detailed import paths for (some of) the these imports:

package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/base.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/base.dart => package:mobile_scanner/src/web/media.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => package:mobile_scanner/src/web/base.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => package:mobile_scanner/src/web/base.dart => package:mobile_scanner/src/web/media.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => package:mobile_scanner/src/web/base.dart => package:js/js.dart => dart:js
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => package:mobile_scanner/src/web/base.dart => package:mobile_scanner/src/web/media.dart => package:js/js.dart => dart:js

../../../../../.pub-cache/hosted/pub.dev/js-0.6.7/lib/js_util.dart:8:1: Error: Dart library 'dart:js_util' is not available on this platform. export 'dart:js_util'; ^ Context: The unavailable library 'dart:js_util' is imported through these packages:

package:smartshoe_updated => package:mobile_scanner => package:js => dart:js_util

Detailed import paths for (some of) the these imports:

package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/base.dart => package:js/js_util.dart => dart:js_util
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/jsqr.dart => package:mobile_scanner/src/web/base.dart => package:js/js_util.dart => dart:js_util
package:smartshoe_updated/main.dart => package:smartshoe_updated/core/routes/mainPage.dart => package:smartshoe_updated/core/routes/register/macScanPage.dart => package:mobile_scanner/mobile_scanner_web.dart => package:mobile_scanner/src/web/zxing.dart => package:mobile_scanner/src/web/base.dart => package:js/js_util.dart => dart:js_util

../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:5:8: Error: Dart library 'dart:html' is not available on this platform. import 'dart:html'; ^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:54:28: Error: Type 'VideoElement' not found. void prepareVideoElement(VideoElement videoSource) { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:61:5: Error: Type 'MediaStream' not found. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:62:5: Error: Type 'VideoElement' not found. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:92:31: Error: Type 'VideoElement' not found. Future<Code?> _captureFrame(VideoElement video) async { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:54:28: Error: 'VideoElement' isn't a type. void prepareVideoElement(VideoElement videoSource) { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:61:5: Error: 'MediaStream' isn't a type. MediaStream stream, ^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:62:5: Error: 'VideoElement' isn't a type. VideoElement videoSource, ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:92:31: Error: 'VideoElement' isn't a type. Future<Code?> _captureFrame(VideoElement video) async { ^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/mobile_scanner-4.0.1/lib/src/web/jsqr.dart:95:9: Error: The method 'CanvasElement' isn't defined for the class 'JsQrCodeReader'.

Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

BUILD FAILED in 3s Error: Gradle task assembleDebug failed with exit code 1 `

This is the following Error Log.

governedbyprudence commented 1 month ago

Alright my bad. I imported the web version in my android code.