brasizza / sunmi_printer

BSD 3-Clause "New" or "Revised" License
39 stars 46 forks source link

got this error "Execution failed for task ':app:minifyReleaseWithR8'." when use the pacakge #34

Closed abdullah-khudher closed 2 years ago

abdullah-khudher commented 2 years ago

I faced this error when trying to run this flutter build apk --release

/Users/abd/StudioProjects/liefer-app-store/build/flutter_sunmi_printer/intermediates/runtime_library_classes_jar/release/classes.jar: R8: Type woyou.aidlservice.jiuiv5.ICallback$Default is defined multiple times: /Users/abd/StudioProjects/liefer-app-store/build/flutter_sunmi_printer/intermediates/runtime_library_classes_jar/release/classes.jar:woyou/aidlservice/jiuiv5/ICallback$Default.class, /Users/abd/StudioProjects/liefer-app-store/build/sunmi_printer_plus/intermediates/runtime_library_classes_jar/release/classes.jar:woyou/aidlservice/jiuiv5/ICallback$Default.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/abd/StudioProjects/liefer-app-store/build/flutter_sunmi_printer/intermediates/runtime_library_classes_jar/release/classes.jar:woyou/aidlservice/jiuiv5/ICallback$Default.class

* 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 1m 57s
Running Gradle task 'assembleRelease'...                          118.4s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
│ To disable the shrinker, pass the `--no-shrink` flag to this command.      │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1

Do you think because I am using flutter_sunmi_printer: ^0.2.1 and sunmi_printer_plus: ^2.1.00 packages at the same time?

brasizza commented 2 years ago

Could be mate. because the both packages use the same AIDL methods to compile try to use just once, there is no explanation to have 2 packages that do the same thing. Mine has a lot of more features, but keep free to choose the best for you!