Skip to content

version 6.1.1 Error: 'Enum' isn't a type. #634

Description

@IgorEstevao

Platform:

  • Dart
  • Flutter Android or iOS
  • Flutter Web

IDE:

  • VSCode
  • IntelliJ/AS
  • XCode
  • Other, which one?

split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):

  • Enabled
  • Disabled

Platform installed with:

  • pub.dev
  • GitHub

Output of the command flutter doctor -v below:

[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [versão 10.0.18363.1916], locale pt-BR)
    • Flutter version 2.2.3 at D:\Dev\flutter\flutter
    • Framework revision f4abaa0735 (4 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Igor\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.62.2)
    • VS Code at C:\Users\Igor\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.28.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 95.0.4638.69
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 95.0.1020.44

• No issues found!

The version of the SDK (See pubspec.lock):
>=2.12.0 <3.0.0


I have the following issue:

I have the following issue: yesterday, when i was trying to build my app i was getting this error, since the rest of the week everything was normal, i started to debug and see where the error was coming from, and then i found a new release of sentry, (version 6.1.1 - released 11/11/2021)

the problem is comming from sentry-6.1.1/lib/src/utils.dart:35:23

maybe something broke after the release?

$ flutter build apk

 Building with sound null safety 

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
../flutter/.pub-cache/hosted/pub.dartlang.org/sentry-6.1.1/lib/src/utils.dart:35:23: Error: 'Enum' isn't a type.
  if (nonEncodable is Enum) {
                      ^^^^
                                                                        
                                                                        
FAILURE: Build failed with an exception.

* Where:
Script 'D:\Dev\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'D:\Dev\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 27s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                      28,4s
Gradle task assembleRelease failed with exit code 1

the temporary solution is to downgrade to 5.1.0
Steps to reproduce:
run the command: flutter build apk

Actual result:
error
Expected result:
build should work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions