star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
83 stars 54 forks source link

[Android] Cannot build due to "Duplicate class a.a.a.a found in modules" #54

Closed yhirano closed 1 year ago

yhirano commented 2 years ago

When building our app for Android using react-native-star-io10, the following error occurred. This error seems to occur because react-native-star-io10 and other libraries have conflicting obfuscated class names.

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class a.a.a.a found in modules jetified-other-runtime (other.aar) and jetified-stario10-runtime (stario10.aar)
     Duplicate class a.a.a.a$a found in modules jetified-other-runtime (other.aar) and jetified-stario10-runtime (stario10.aar)
     Duplicate class a.a.a.a$a$a found in modules jetified-another-runtime (another.aar) and jetified-stario10-runtime (stario10.aar)

To fix this problem, can you change interface names in stario10.aar to globally unique interface names, or hide interfaces obfuscated interfaces like a.a.a.a? I cannot fix this problem myself because stario10.aar is a closed library.

nagai-smjp commented 2 years ago

I'm Nagai of Star Marketing Japan. Thank you to give us this issue. I understood your problem, but unfotunatery I have no answer. Bandit, Please give us your advice.

nagai-smjp commented 2 years ago

We received the information from Star Micronics. Star Micronics plans to support this in the next Ver. The timing is undecided. Thanks, Nagai.

yhirano commented 2 years ago

There may be a problem with the obfuscation settings. I'm guessing that setting -keeppackagenames to Proguard/R8 may solve this problem.

The following may be helpful for you. https://stackoverflow.com/questions/67492135/how-can-i-obfuscate-the-package-names-for-two-different-aar-without-having-du

nagai-smjp commented 2 years ago

Thank you for providing useful information. We will use it as a reference for the next Ver.

nagai-smjp commented 2 years ago

@yhirano Star Micronics fixed this problem on Star Xpand SDK for ReactNative Ver.1.2.0. This SDK is already available. The official comment from Star Micronics is as below. Thanks.

[Android]

gare-bear commented 1 year ago

@yhirano i'm going to close this issue since it has been fixed. we'd love to get your feedback if you have any.