简体   繁体   中英

flutter_downloader build exception

I want to use flutter_downloader 1.1.6 in my project, flutter packages get is complete but I can't build an apk, it throws exception:

Launching lib\main.dart on ONEPLUS A5000 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...

Finished with error: FormatException: Bad UTF-8 encoding 0xb4 (at offset 166)

Here is my dependencies:

dependencies:
  flutter:
    sdk: flutter

  dio: ^1.0.13

  crypto: ^2.0.6

  fluttertoast: ^2.2.6

  sqflite: ^1.0.0
  path_provider: ^0.5.0+1
  shared_preferences: ^0.4.2

  url_launcher: ^4.0.0

  zefyr: ^0.3.1

  cached_network_image: ^0.6.0+1
  image_picker: ^0.4.5

  flutter_downloader: ^1.1.6

I have tried some solutions on the Internet but they don't work. I want to know how to fix the problem and why it occurs.

Copying my own answer from similar SO question.

I saw similar errors a few days ago, and found out I needed to upgrade my project to support AndroidX.

I was able to migrate flutter project to support AndroidX without having to use Android studio.

Here's what I did:

updated compileSdkVersion in build.gradle file to 28 and android.useAndroidX=true and android.enableJetifier=true in gradle.properties

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM