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

FlutterError: Failed to find definition for url(#paint0_linear) #838

Closed
1 task done
SriramPatibanda opened this issue Dec 23, 2021 · 1 comment · Fixed by #840
Closed
1 task done

FlutterError: Failed to find definition for url(#paint0_linear) #838

SriramPatibanda opened this issue Dec 23, 2021 · 1 comment · Fixed by #840
Labels
bug Something isn't working

Comments

@SriramPatibanda
Copy link

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

Android

What version are you using?

^3.3.2

What happened?

When a file is attached, this error is thrown:

The following assertion was thrown while parsing AssetBundlePictureKey(bundle: PlatformAssetBundle#0fc45(), name: "packages/stream_chat_flutter/lib/svgs/filetype_Generic.svg", colorFilter: null) in _getDefinitionPaint:
Failed to find definition for url(#paint0_linear)

This library only supports <defs> and xlink:href references that are defined ahead of their references.

This error can be caused when the desired definition is defined after the element referring to it (e.g. at the end of the file), or defined in another file.

This error is treated as non-fatal, but your SVG file will likely not render as intended

Editing the SVG code by bringing the <def> tags to the top of the SVG file can resolve this issue.

This can be helpful: https://stackoverflow.com/questions/61202925/svgpicture-image-rendering-error-in-flutter

Steps to reproduce

1. Go to 'message text field'
2. Click on 'attach icon'
3. Click on 'Files icon'
4. Choose any '.jpg file'

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@SriramPatibanda SriramPatibanda added the bug Something isn't working label Dec 23, 2021
@deven98
Copy link
Contributor

deven98 commented Dec 27, 2021

Hi @SriramPatibanda,

I can confirm this error occurs with the current SVGs in the SDK due to the existing Flutter issue.
I will let you know when I have a PR ready with the fix.

Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants