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

Invalid argument: Instance of 'Reference' #47

Open
vborbely opened this issue Jun 2, 2021 · 1 comment
Open

Invalid argument: Instance of 'Reference' #47

vborbely opened this issue Jun 2, 2021 · 1 comment

Comments

@vborbely
Copy link

vborbely commented Jun 2, 2021

Expected Behaviour

The Firebase Image should be able to update the local DB cache.

Actual Behaviour

The Firebase Image tries to update the local DB cache, but fails.

Android Studio reports the following error:

`======== Exception caught by image resource service ================================================
The following ArgumentError was thrown resolving an image codec:
Invalid argument: Instance of 'Reference'

When the exception was thrown, this was the stack:
#0 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:419:7)
#1 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:409:9)
#2 StandardMessageCodec.writeValue. (package:flutter/src/services/message_codecs.dart:416:9)
#3 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
#4 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:414:13)
...
====================================================================================================`

Specifications

  • Version: 1.0.1
  • Device: NordOne Plus
  • Platform: Android
  • Flutter Version:

Flutter 2.2.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b22742018b (3 weeks ago) • 2021-05-14 19:12:57 -0700
Engine • revision a9d88a4d18
Tools • Dart 2.13.0

I found this error on MacOS (Big Sur), but not on Linux Mint.

@vborbely
Copy link
Author

vborbely commented Jun 2, 2021

The problem is in image_object.dart file, with the toMap() method. The reference should call a toString() method, because the local DB does not accept Reference type.

Other problem, I found, the DB schema does not contain the reference column. It is missing in the cache_manager.dart file, in the open() method.

CREATE TABLE $table (
uri TEXT PRIMARY KEY,
remotePath TEXT,
localPath TEXT,
reference TEXT,
bucket TEXT,
version INTEGER
)

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

1 participant