0

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.

2
  • 1
    Have you migrated your app to support AndroidX? I wonder if that would help Commented Mar 1, 2019 at 0:56
  • great, feel free to accept the answer, that may help others understand the fix :) Commented Mar 6, 2019 at 4:02

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

1 Comment

I confirm by doing flutter upgrade to newest version, and follow this answer, the built is successful, as at 2019/03/21.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.