Chirag Nahata
Chirag Nahata

Reputation: 1

Flutter build issue apk build fail

I am getting the following issue while building the apk :

/C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.3.3/lib/src/structs.g.dart:661:31: Error: Member not found: 'UnicodeChar'. int get UnicodeChar => Char.UnicodeChar; ^^^^^^^^^^^ /C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.3.3/lib/src/structs.g.dart:662:38: Error: Setter not found: 'UnicodeChar'. set UnicodeChar(int value) => Char.UnicodeChar = value; ^^^^^^^^^^^ /C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.3.3/lib/src/structs.g.dart:664:29: Error: Member not found: 'AsciiChar'. int get AsciiChar => Char.AsciiChar; ^^^^^^^^^ /C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.3.3/lib/src/structs.g.dart:665:36: Error: Setter not found: 'AsciiChar'. set AsciiChar(int value) => Char.AsciiChar = value; ^^^^^^^^^ /C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_calendar_carousel-1.5.3/lib/flutter_calendar_carousel.dart:424:16: Error: The method 'FlatButton' isn't defined for the c lass '_CalendarState'.

WARNING: This version of flutter_webview_plugin will break your Android build if it or its dependencies aren't compatible with AndroidX. See https://docs.flutter.dev/development/platform-integration/android/androidx-migration for more information on the problem and how to fix it. This warning prints for all Android build failures. The real root cause of the error may be unrelated. *********************************************************

FAILURE: Build failed with an exception.

Process 'command 'C:\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

BUILD FAILED in 1m 20s Running Gradle task 'assembleRelease'... 81.7s Gradle task assembleRelease failed with exit code 1

Link to the project source code - https://drive.google.com/drive/folders/1GaNcymRQ1SmQDln-0JpsoEG_9Gy3sOn7?usp=sharing

Please help as soon as possible.

Thank You

Upvotes: 0

Views: 352

Answers (1)

Shashank Deepak
Shashank Deepak

Reputation: 317

By looking at this section of error, your dependencies might not be compatible with AndroidX.

WARNING: This version of flutter_webview_plugin will break your Android build if it or its dependencies aren't compatible with AndroidX.

According to this github issue you need to migrate to AndroidX. To migrate follow these steps -

1 - Open android directory with Android Studio 3.2+.

2 - Click on Refactor then migrate to AndroidX.

enter image description here

After that add these to the gradle.properties file in the android directory.

android.useAndroidX=true 
android.enableJetifier=true

Upvotes: 1

Related Questions