llfbandit / record

Audio recorder from microphone to a given file path. No external dependencies, MediaRecorder is used for Android an AVAudioRecorder for iOS.
https://pub.dev/packages/record
245 stars 203 forks source link

record: 5.2.0 build fail,Execution failed for task ':app:mergeLibDexDebug' #429

Closed sumaro closed 3 weeks ago

sumaro commented 3 weeks ago

ERROR:\example\build\record_android\intermediates\runtime_library_classes_dir\debug\com\llfbandit\record\record\format\Format.class: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes

Execution failed for task ':app:mergeLibDexDebug'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform debug (project :record_android) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.3.0, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}. Execution failed for DexingNoClasspathTransform: example\build\record_android\intermediates\runtime_library_classes_dir\debug. Error while dexing.

sumaro commented 3 weeks ago

record_platform_interface: 1.2.0 may be causing the problem record_platform_interface: 1.1.0 is ok

mevljas commented 3 weeks ago

I have a similar problem

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeLibDexDevelopmentDebug'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
   > Failed to transform classes.jar (project :record_android) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.3.1, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, 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 DexingWithClasspathTransform: /Users/mevljas/Projects/Flokkie/build/record_android/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.
mevljas commented 3 weeks ago
dependency_overrides:
  record_android: 1.2.6

Solved my issue.

llfbandit commented 3 weeks ago

Upgrade your setup. Here are the latest versions for AGP v7

Android Gradle Plugin 7.4.2 https://github.com/llfbandit/record/blob/master/record_android/README.md

Gradle 7.6.4 In android/gradle/wrapper/gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip

Updating Android studio is also a good practice.

Nikunj-Flutter commented 1 week ago

Your project's Gradle version is incompatible with the Java version that Flutter is using for Gradle. │ │ │ │ If you recently upgraded Android Studio, consult the migration guide at https://flutter.dev/to/to/java-gradle-incompatibility. │ │ │ │ Otherwise, to fix this issue, first, check the Java version used by Flutter by runningflutter doctor --verbose. │ │ │ │ Then, update the Gradle version specified in /Users/nikunj/Desktop/Work/help_app/android/gradle/wrapper/gradle-wrapper.properties to be compatible with │ │ that Java version. See the link below for more information on compatible Java/Gradle versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java

I tried the solution but the java version is incapable which java version should i use with record 5.2.0

hxmeie commented 1 week ago

Your project's Gradle version is incompatible with the Java version that Flutter is using for Gradle. │ │ │ │ If you recently upgraded Android Studio, consult the migration guide at https://flutter.dev/to/to/java-gradle-incompatibility. │ │ │ │ Otherwise, to fix this issue, first, check the Java version used by Flutter by runningflutter doctor --verbose. │ │ │ │ Then, update the Gradle version specified in /Users/nikunj/Desktop/Work/help_app/android/gradle/wrapper/gradle-wrapper.properties to be compatible with │ │ that Java version. See the link below for more information on compatible Java/Gradle versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java

I tried the solution but the java version is incapable which java version should i use with record 5.2.0

flutter config --jdk-dir path-to-java-sdk-17-home-directory