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

Flutter Web AssetNotFoundException #12

Closed
mkiisoft opened this issue Aug 4, 2019 · 9 comments
Closed

Flutter Web AssetNotFoundException #12

mkiisoft opened this issue Aug 4, 2019 · 9 comments

Comments

@mkiisoft
Copy link

mkiisoft commented Aug 4, 2019

While trying to import the library, I'm getting the following errors:

[WARNING]build_web_compilers:entrypoint on web/main.dart: Unable to read hive|lib/hive.ddc.js, check your console or the `.dart_tool/build/generated/hive/lib/hive.ddc.js.errors` log file.
[SEVERE]build_web_compilers:entrypoint on web/main.dart: AssetNotFoundException: hive|lib/hive.ddc.js
@simc
Copy link
Member

simc commented Aug 5, 2019

What does the hive.ddc.js.errors log file say?

@mkiisoft
Copy link
Author

mkiisoft commented Aug 5, 2019

@leisim I wasn't aware of a log, let me try to install it again and check the logs (I'll update this response)

UPDATE:

Error compiling dartdevc module:hive|lib/hive.ddc.js

[error] Target of URI doesn't exist: 'package:hive/src/backend/storage_backend_stub.dart'. (package:hive/src/box/box_impl.dart, line 14, col 8)

Please fix all errors before compiling (warnings are okay).
}

@simc
Copy link
Member

simc commented Aug 5, 2019

Thanks!

@mkiisoft
Copy link
Author

mkiisoft commented Aug 5, 2019

Done, apparently is an URI issue.

@simc
Copy link
Member

simc commented Aug 5, 2019

This is strange... I don't manage to reproduce the error. Could you explain me how you get this error?

@mkiisoft
Copy link
Author

mkiisoft commented Aug 5, 2019

I'm using Flutter Web:

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-US)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
[!] Connected device

Flutter 1.7.8+hotfix.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 20e59316b8 (3 weeks ago) • 2019-07-18 20:04:33 -0700
Engine • revision fee001c93f
Tools • Dart 2.4.0

This is my .yaml

environment:
  # You must be using Flutter >=1.5.0 or Dart >=2.3.0
  sdk: '>=2.3.0-dev.0.1 <3.0.0'

dependencies:
  flutter_web: any
  flutter_web_ui: any
  firebase: any
  service_worker: ^0.2.3
  hive: ^0.3.0+1

dev_dependencies:
  build_runner: ^1.6.5
  build_web_compilers: '>=1.0.0 <2.0.0'
  pedantic: ^1.8.0+1

flutter:
  uses-material-design: true

dependency_overrides:
  flutter_web:
    git:
      url: https://github.com/flutter/flutter_web
      path: packages/flutter_web
  flutter_web_ui:
    git:
      url: https://github.com/flutter/flutter_web
      path: packages/flutter_web_ui

All I did was adding:

import 'package:hive/hive.dart';

tried to compile the code and I got that error when using: webdev serve

@simc
Copy link
Member

simc commented Aug 5, 2019

Perfect thanks... I'll fix it 👍

@simc
Copy link
Member

simc commented Aug 17, 2019

The new version (0.4.0) should fix your problem.

@simc
Copy link
Member

simc commented Aug 20, 2019

Here is a demo using flutter_web: https://leisim.github.io/hive/demo

@simc simc closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants