Skip to content

Error when trying to use the record lib for build Flutter applications on Android Devices: PermittedSubclasses requires ASM9 #457

@rxfaelr

Description

@rxfaelr

Package version
record 5.2.0

Environment

  • OS: MacOS Sequoia 15.0
  • Flutter Version: 3.24.5
  • Dart Version: 3.5.4
  • Gradle Version: 7.1.1
  • Kotlin Version: 1.9.10
  • Android SDK Version: 36.0.0
  • Java OpenJDK Version: 17.0.10

Description of the bug

Unable to build Flutter applications for Android devices when using the Record lib for audio recording
When trying to compile the application, the following error is returned:

Failed to transform classes.jar (project :record_android) to match attributes {artifactType=android-dex, asm-transformed-variant=appDebug, com.android.build.api.attributes.AgpVersionAttr=7.1.1, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=25, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
Execution failed for AsmClassesTransform: /Users/build/record_android/intermediates/runtime_library_classes_jar/debug/classes.jar.
PermittedSubclasses requires ASM9

The compatibility of various points in the application was checked, such as versions of Java and Gradle, versions of other libs in use, versions of Kotlin, Dart and Flutter and the Android SDK and in all the tests, the errors displayed were related to the 'record' lib.

When the lib is removed from the application, the build is successful without any other errors.

The record Config for this application is:

RecordConfig(
encoder: AudioEncoder.aacLc,
),

To Reproduce

There is no specific sequence of steps to reproduce this error, as it is a compilation error.

Expected behavior

That it is possible to build projects for Android devices in an environment similar to the one mentioned using any version of the lib, since in all versions the same error related to class conversion by this lib is returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions