material-foundation/flutter-packages

IOS app stop working after installing google_fonts package

Wahab92422 opened this issue · 5 comments

Package

google_fonts

Existing issue?

What happened?

Expected vs actual result:

Steps to reproduce:

  1. Install package google_fonts
  2. Add import 'package:google_fonts/google_fonts.dart'; in any file
  3. After that your app stop working if its running & if you are trying to install then build fails

Steps to fix this error

  1. First of all go to location .pub-cache/hosted/pub.dev/http-1.1.0/lib/src in your system (I'm using mac)
  2. Open file io_client.dart
  3. Search for tthrow keyword & change it to throw.
  4. After that your app start working fine.

Relevant log output

Flutter (Channel stable, 3.13.2, on macOS 13.5 22G74 darwin-x64, locale en-GB)
    • Flutter version 3.13.2 on channel stable at /Users/mac/FlutterDev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (13 days ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.70.1)
    • VS Code at /Users/mac/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.60.0

[✓] Connected device (4 available)
    • AbdulWahab’s iPhone (mobile) • 00008020-000A7D5A0C6A002E            • ios            • iOS 16.6 20G75
    • iPhone 13 (mobile)           • 07CC9DE2-D1A5-4B3C-A3E2-E0E2C3E2BEEF • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)              • macos                                • darwin-x64     • macOS 13.5 22G74 darwin-x64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 116.0.5845.179

[✓] Network resources
    • All expected network resources are available.

• No issues found!


## Error output

../../../.pub-cache/hosted/pub.dev/http-1.1.0/lib/src/io_client.dart:119:7: Error: 'tthrow' isn't a type.
      tthrow _ClientSocketException(error, request.url);
      ^^^^^^
../../../.pub-cache/hosted/pub.dev/http-1.1.0/lib/src/io_client.dart:119:14: Error: Expected ';' after this.
      tthrow _ClientSocketException(error, request.url);
             ^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/http-1.1.0/lib/src/io_client.dart:79:30: Error: A non-null value must be returned since the return type
'IOStreamedResponse' doesn't allow null.
 - 'IOStreamedResponse' is from 'package:http/src/io_streamed_response.dart'
 ('../../../.pub-cache/hosted/pub.dev/http-1.1.0/lib/src/io_streamed_response.dart').
  Future<IOStreamedResponse> send(BaseRequest request) async {

This seems to be an error on your end. I downloaded http 1.1.0 and there's no issue. Closing
image

@guidezpl I got this issue after installing the package google_fonts.

If you clear the pub cache and try again, does it occur?

Sorry but I'm unable to repro when using the latest google_fonts and having cleared ~/.pub-cache.