dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.67k stars 458 forks source link

[severe][web on iOS] Not working any more!!! #397

Closed tomasbaran closed 4 years ago

tomasbaran commented 4 years ago

I have no idea how it's possible. The web version is working well on macOS, on Android but not on iOS (not working on iOS 12 nor on iOS 14). It's been a few days since I noticed it but thought there must have been an issue with my phone.

You can check it out

I used adobe.svg from https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/

min repro code ```dart import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State { @override Widget build(BuildContext context) { return DefaultTabController( length: 3, child: Scaffold( backgroundColor: Colors.grey, body: Center( child: Container( child: SvgPicture.asset( 'icons/adobe.svg', color: Colors.green, height: 28, ), )), ), ); } } ```
flutter doctor -v ``` [✓] Flutter (Channel beta, 1.20.0-7.3.pre, on Mac OS X 10.15.3 19D76, locale es-ES) • Flutter version 1.20.0-7.3.pre at /Users/tomasbaran/dev/flutter • Framework revision e606910f28 (2 weeks ago), 2020-07-28 16:06:37 -0700 • Engine revision ac95267aef • Dart version 2.9.0 (build 2.9.0-21.10.beta) [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location. You may also want to add it to your PATH environment variable. [✗] Xcode - develop for iOS and macOS ✗ Xcode installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). [✓] VS Code (version 1.47.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.13.2 [✓] Connected device (2 available) • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 84.0.4147.125 ! Doctor found issues in 3 categories. ```
dnfield commented 4 years ago

I'm able to render adobe.svg on an iPhone running iOS 13.6 locally. I did not try your example, but the example project in this repo is working fine and loads assets similarly to how you are.

Are you able to run the example app on iOS?

It's not clear to me that this is a bug in flutter_svg....

tomasbaran commented 4 years ago

@dnfield Sorry, I should have made clearer that I'm talking about [web] version on iOS. I have NOT tested the web version on iOS 13, only on iOS 12 and iOS 14.

Did you try the live link on iOS 13? Did it render?

dnfield commented 4 years ago

Safari on iOS 13 does not work for this page - I get the following in the console:

/cc @yjbanov @hterkelsen who might know what's going on.

I suspect this is a bug in Flutter though.

[Error] TypeError: null is not an object (evaluating 'q.b')
    HZ (main.dart.js:16378)
    te (main.dart.js:14321)
    (anonymous function) (Anonymous Script 1 (line 2))
    $1 (main.dart.js:20708)
    a3k (main.dart.js:1570)
    (anonymous function) (main.dart.js:1578)
[Error] WebGL: ERROR: 0:52: 'do' : This type of loop is not allowed
    compileShader
    Va (canvaskit.js:282:185)
    wasm-stub
    <?>.wasm-function[1850]
    <?>.wasm-function[1249]
    <?>.wasm-function[13007]
    <?>.wasm-function[5093]
    <?>.wasm-function[3310]
    <?>.wasm-function[5216]
    <?>.wasm-function[5260]
    <?>.wasm-function[5204]
    <?>.wasm-function[703]
    <?>.wasm-function[6288]
    <?>.wasm-function[7118]
    <?>.wasm-function[7277]
    <?>.wasm-function[2707]
    <?>.wasm-function[3809]
    <?>.wasm-function[2179]
    <?>.wasm-function[5478]
    <?>.wasm-function[9800]
    <?>.wasm-function[4319]
    <?>.wasm-function[1873]
    <?>.wasm-function[4083]
    wasm-stub
    Qh
    (anonymous function) (canvaskit.js:306:514)
    dynCall_vii_452 (Anonymous Script 2 (line 3))
    SkCanvas$flush (Anonymous Script 3 (line 7))
    E (main.dart.js:20948)
    X (main.dart.js:20949)
    $2 (main.dart.js:14083)
    qt (main.dart.js:14042)
    YX (main.dart.js:2776)
    Gt (main.dart.js:13993)
    FJ (main.dart.js:28726)
    ok (main.dart.js:26150)
    ok (main.dart.js:31263)
    Ci (main.dart.js:26144)
    (anonymous function) (Anonymous Script 4 (line 2))
    t3 (main.dart.js:28868)
    t2 (main.dart.js:28874)
    vy (main.dart.js:28859)
    BT (main.dart.js:28841)
    (anonymous function) (Anonymous Script 5 (line 2))
    Q_ (main.dart.js:491)
    $1 (main.dart.js:12923)
    a3k (main.dart.js:1570)
    (anonymous function) (main.dart.js:1578)
[Error] WebGL: INVALID_OPERATION: useProgram: program not valid
    useProgram
    Xg (canvaskit.js:300:89)
    wasm-stub
    <?>.wasm-function[1850]
    <?>.wasm-function[5258]
    <?>.wasm-function[5190]
    <?>.wasm-function[13003]
    <?>.wasm-function[13007]
    <?>.wasm-function[5093]
    <?>.wasm-function[3310]
    <?>.wasm-function[5216]
    <?>.wasm-function[5260]
    <?>.wasm-function[5204]
    <?>.wasm-function[703]
    <?>.wasm-function[6288]
    <?>.wasm-function[7118]
    <?>.wasm-function[7277]
    <?>.wasm-function[2707]
    <?>.wasm-function[3809]
    <?>.wasm-function[2179]
    <?>.wasm-function[5478]
    <?>.wasm-function[9800]
    <?>.wasm-function[4319]
    <?>.wasm-function[1873]
    <?>.wasm-function[4083]
    wasm-stub
    Qh
    (anonymous function) (canvaskit.js:306:514)
    dynCall_vii_452 (Anonymous Script 2 (line 3))
    SkCanvas$flush (Anonymous Script 3 (line 7))
    E (main.dart.js:20948)
    X (main.dart.js:20949)
    $2 (main.dart.js:14083)
    qt (main.dart.js:14042)
    YX (main.dart.js:2776)
    Gt (main.dart.js:13993)
    FJ (main.dart.js:28726)
    ok (main.dart.js:26150)
    ok (main.dart.js:31263)
    Ci (main.dart.js:26144)
    (anonymous function) (Anonymous Script 4 (line 2))
    t3 (main.dart.js:28868)
    t2 (main.dart.js:28874)
    vy (main.dart.js:28859)
    BT (main.dart.js:28841)
    (anonymous function) (Anonymous Script 5 (line 2))
    Q_ (main.dart.js:491)
    $1 (main.dart.js:12923)
    a3k (main.dart.js:1570)
    (anonymous function) (main.dart.js:1578)
tomasbaran commented 4 years ago

I just added my flutter doctor -v log in my original post for better investigation. Btw, it doesn't work on Chrome Browser on iOS either.

dnfield commented 4 years ago

Going to close this in favor of the upstream bug.