Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rxfaelr opened this issue Jan 6, 2025 · 1 comment

Comments

@rxfaelr
Copy link

rxfaelr commented Jan 6, 2025

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.

@llfbandit
Copy link
Owner

You should update AGP and Gradle also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants