testfairy / react-native-testfairy

React Native component for TestFairy SDK
https://www.testfairy.com
Apache License 2.0
33 stars 12 forks source link

2.21.0 version has duplicated class error on Android #28

Closed Sly777 closed 3 years ago

Sly777 commented 4 years ago

Hey all,

After upgrading testfairy package from 2.20.4 to 2.21.0, we started to get the error on Android. You can find it below. I just added one line of error but it gives a completely same error for other testfairy classes as well.

 Duplicate class com.testfairy.utils.v found in modules classes.jar (testfairy:testfairy-android-sdk:1.9.19) and jetified-testfairy-android-sdk-1.9.19.jar (testfairy:testfairy-android-sdk:1.9.19)

When I reverted back to the old version, it works.

React native: 0.61.4 React: 16.9.0 Jetified: True AndroidX: True

vijaysharm commented 4 years ago

HI @Sly777 Thank you for reporting this issue. Can you tell me which version of android-studio, and or android build tools you're using?

Sly777 commented 4 years ago

Hey @vijaysharm I just use react-native run-android (without expo). but anyhow maybe it can help;

android-studio: 3.5.2

android-build tools info;

vijaysharm commented 4 years ago

Thanks @Sly777, did this happen when you migrated your project? or was this from a brand new project? If it was a migration from one version of RN to another, do you recall the previous version you had before migration?

Sly777 commented 4 years ago

hey @vijaysharm, so it was updating the version of this package 2.20.4 to 2.21.0 only. As far as we know, there are no specific changes for this package except package.json change. It works well on iOS but not android.

vijaysharm commented 4 years ago

Hi @Sly777

I can't seem to reproduce the issue. I ran the following commands, which are to create a project, add the TestFairy SDK (version 2.20.4), and compile the android component. Then i upgrade to 2.21.0, and recompile, and i get a successful build. Is there a step here that I'm missing?

> react-native init AwesomeProject
> cd AwesomeProject
> npm install --save react-native-testfairy@2.20.4
> react-native link react-native-testfairy
# edit index.js to call TestFairy.begin()
> cd android
> ./gradlew assembleDebug # build passes successfully
> cd ..
> npm install --save react-native-testfairy@2.21.0
> cd android
> ./gradlew assembleDebug # build passes successfully